随手记

90 阅读1分钟
var a = {b:1}
a.hasOwnProperty('b') //true
'b' in a //true

image.png

可以通过ontouchstart判断是否在移动端环境

 var isMobile = 'ontouchstart' in document //true or false