Problem for example: In general null object means additional class which handle cases when object not found etc.
In Ruby you can also define method for Nil class. And I want realise something similiar in js.
That's what gives me hope typeof(null) //=> object, but in same time null instanceof Object //=> false. So defining method for Object gives me nothing.
So the final question: is there any hacks to define method on built-in types?
__proto__or getters and setters. Now (when I understand futility of my question)typeof(null) //=> objectseems like a joke of js developer. It's funny represent it like haskelldata object = null | Object a