Skip to content

Instantly share code, notes, and snippets.

@lushchick
Forked from padolsey/1.js
Last active December 14, 2015 02:49
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 lushchick/5016434 to your computer and use it in GitHub Desktop.
Save lushchick/5016434 to your computer and use it in GitHub Desktop.
var x = '/x/';
/x/==x
var calls = 0;
function x() {
return (++calls % 6) > 0 ? x : true;
};
x() === x()() === x()()()
var x = {
n: 0,
valueOf: function() {
return ++this.n % 2 ? 3 : 1;
}
}
x > 2 && x < 2
var fn = function() {
this.a = 'qwe';
};
fn.prototype.a = true;
var x = new fn();
delete x.a && x.a;
var x = {
foo: 'foo',
toString: function() {
return 'foo';
}
}
x[x]==x
var x = function() {
x = 'p';
}
typeof new x < typeof x
var x = {
n: 0,
valueOf: function() {
return (++this.n % 2) ? 1 : -1;
}
}
x - 1 === x + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment