Skip to content

Instantly share code, notes, and snippets.

@PetterRuud
Created October 8, 2019 11:25
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 PetterRuud/e56e90b3ed51743b16885df0251e2c66 to your computer and use it in GitHub Desktop.
Save PetterRuud/e56e90b3ed51743b16885df0251e2c66 to your computer and use it in GitHub Desktop.
[] + {} // "[object Object]"
{} + [] // 0
var x = true, y = "42";
x == y; // false
y = 'true'
x == y // false
var a = { b: 42 };
var b = { b: 42 };
a == b; // false. Checks if a and b point to the same object.
a < b; // false
a > b; // false
a <= b; // true
a >= b; // true
var a = 42
//++a++ // ??
// make sure you are in the global scope
name = function (me) {
console.log(`I am ${me}! :)`)
}
name('Parama'); // TypeError: name is not a function
undefined == null // true
null + 1 // 1
undefined + 1 // NaN
var { a: X, a: Y, a: [ Z ] } = { a: [ 1 ] } ;
X.push( 2 );
Y[0] = 10;
X; // [10,2] Woah!!
Y; // [10,2] What now?
Z; // 1
for(let i=(setTimeout(()=>console.log(i)),0); i<2; i++) {
i++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment