Last Updated: February 25, 2016
·
926
· brandturner

Eloquent JS Objects

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();