08 2020 档案

摘要:1、使用Array.includes来处理多个条件 一般写法: function test(fruit) { if (fruit == 'apple' || fruit == 'strawberry') { console.log('red'); } } 使用Array.includes重写: fu 阅读全文
posted @ 2020-08-31 15:15 超哥20 阅读(340) 评论(0) 推荐(0)
摘要:1、javaScript检测横屏 window.addEventListener("resize", ()=>{ if(window.orientation 180|| window.orientation 0) { // 正常方向或屏幕旋转180度 console.log('竖屏'); }; if 阅读全文
posted @ 2020-08-05 10:43 超哥20 阅读(251) 评论(0) 推荐(0)