Eloquent Javascript Chap. 4
The operator in can be used to test whether an object has a certain property. For example:
var chineseBox = {};
chineseBox.content = chineseBox;
console.log("content" in chineseBox); // TRUE
console.log('content" in chineseBox.content); //TRUE
Setting one object equal to another just creates a reference to that object. When one object is updated, so is the other since it is a reference and now the creation of a new object.
To test two different dates, you need to test their time values. So: wallFall1.getTime() == wallFall2.getTime();
Written by Brandon Turner
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Related Tags
#javascript
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#