@m2c/GiftedShockedNorthernseahorse
JavaScript

No description

fork
loading
repl talk
(games)
1
2
3
4
5
6
7
8
9
10
11
12
var TestObject =  function() {
  this.valueOf = function() {
    return 42;
  };
  this.toString = function() {
     return "I am a test object";
  };
};

var obj = new TestObject();
console.log(obj == 42); // true
console.log(obj); // I am a test object
Native Browser JavaScript