[javascript] How to determine whether an object has a given property in JavaScript