1.判断问题 如果type存在就设置type的值为type,否则设置type为0: 原始的写法,使用 if else:if(type){type = type} 使用三元操作符:type : type ? type : 0 使用"或": type : type || 0 · if(a){alert('ok')} 等价于 a && alert('ok') 2. && 和 || 例子: var a = 2; var b = 3; var andflag =…
我的移动端media html{font-size:10px} @media screen and (min-width:321px) and (max-width:375px){html{font-size:11px}} @media screen and (min-width:376px) and (max-width:414px){html{font-size:12px}} @media screen and (min-width:415px) and (max-width:639px){…