Skip to content

Instantly share code, notes, and snippets.

@vadjs
Last active August 7, 2018 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vadjs/a8dc174e7033a0c8f2baa8e9cfdddc4d to your computer and use it in GitHub Desktop.
Save vadjs/a8dc174e7033a0c8f2baa8e9cfdddc4d to your computer and use it in GitHub Desktop.
Fun JS
a = new Date();
b = new Date();
console.log(a == b); //false
console.log(a < b); //false
console.log(a <= b); //true
o = {};
k = {a: 1, b: 2};
o[k] = 1;
console.log(o[k]); //1
console.log({a: 1, b: 2}); //1
k.a = 5;
console.log(o[k]); //1
console.log({a: 1, b: 2}); //1
o[{a: 1, b: 2}] = 2
console.log(o[k]); //2
console.log({a: 1, b: 2}); //2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment