Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例:
var o = {'key': 'value'}; var key = 'key'; console.log('key' in o); //true console.log(key in o); //false
これを行う方法?=)
私はお勧めします:
o.hasOwnProperty(key);
JS フィドルのデモ。
参考文献:
hasOwnProperty()
試してくださいhasOwnProperty:
hasOwnProperty