随手记 李陈浩 2022-03-23 90 阅读1分钟 var a = {b:1} a.hasOwnProperty('b') //true 'b' in a //true 可以通过ontouchstart判断是否在移动端环境 var isMobile = 'ontouchstart' in document //true or false