How do I check if an object has a specific property in JavaScript?Consider:x = {'key': 1};if ( x.hasOwnProperty('key') ) { //Do this} Is that the best way ...
確定! 回上一頁