Re:Prototypes are Objects
by masklinn on Sunday June 14, 2015 @04:22AM
(#9714179)
> If JS objects are just glorified hash maps, why can I write a constructor function to do some stuff when the object is instantiated?
There's no big reason for that, and Object.clone doesn't give that hook, you have to use a wrapper function instead.
> JavaScript is absolutely an object-oriented programming language, but it's unusual because it's also pseudo-functional, in that functions are first-class citizens.
What's unusual about that?
> it's fascinating to learn about because there's no other language that works quite like JS.
That can be said about pretty much any and every language out there.
There's no big reason for that, and Object.clone doesn't give that hook, you have to use a wrapper function instead.
> JavaScript is absolutely an object-oriented programming language, but it's unusual because it's also pseudo-functional, in that functions are first-class citizens.
What's unusual about that?
> it's fascinating to learn about because there's no other language that works quite like JS.
That can be said about pretty much any and every language out there.