Skip to content

Instantly share code, notes, and snippets.

@keithwhor
Last active June 20, 2018 07:11
Show Gist options
  • Save keithwhor/6ad11a67add5860a75b0e8b0e3694af9 to your computer and use it in GitHub Desktop.
Save keithwhor/6ad11a67add5860a75b0e8b0e3694af9 to your computer and use it in GitHub Desktop.
Code.xyz Function: Silly API Example
class A {
constructor () {
this.value = 0;
}
valueOf () {
return ++this.value;
}
toString () {
return this.valueOf();
}
}
/**
* Proves that `(a == 1 && a == 2 && a == 3) == true` can work in JavaScript
*/
module.exports = async () => {
let a = new A();
return [a == 1, a == 2, a == 3];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment