08 2020 档案
摘要:1、使用Array.includes来处理多个条件 一般写法: function test(fruit) { if (fruit == 'apple' || fruit == 'strawberry') { console.log('red'); } } 使用Array.includes重写: fu
阅读全文
摘要:1、javaScript检测横屏 window.addEventListener("resize", ()=>{ if(window.orientation 180|| window.orientation 0) { // 正常方向或屏幕旋转180度 console.log('竖屏'); }; if
阅读全文

浙公网安备 33010602011771号