Skip to content Skip to sidebar Skip to footer
Showing posts with the label Prototype

Not Able To Update A Class Property In Es6

How does this translate to ES6? I've tried this: But it doesn't work because the class pr… Read more Not Able To Update A Class Property In Es6

Js Prototype Objects Not Inherited?

My question is about a strange output that I came across while playing with JS prototypal inheritan… Read more Js Prototype Objects Not Inherited?

Why Defining Properties In The Prototype Is Considered An Antipattern

I often see this pattern to define javascript objects function Person(name) { this.name = name;… Read more Why Defining Properties In The Prototype Is Considered An Antipattern

Why If F - Simple Function: F.prototype!== F.__proto__ But Function.prototype === Function.__proto__?

Why if F - simple function: F.prototype !== F.__proto__ but Function.prototype === Function.__pro… Read more Why If F - Simple Function: F.prototype!== F.__proto__ But Function.prototype === Function.__proto__?

Better Way To Access Private Members In Javascript

After reading a bit on Javascript's prototypical inheritance model, I change my style of constr… Read more Better Way To Access Private Members In Javascript

Resetting The Constructor Property Of Prototype Object

Consider the following snippet: function shape(){ this.name = '2d shape' } function tr… Read more Resetting The Constructor Property Of Prototype Object

Correct Way To Inherit React Components

I understand that my question is a little bit biased, but I am very new in Javascript and prototype… Read more Correct Way To Inherit React Components

Can't Use String#trim As A Callback For Array#map

For some reason I can't use String.prototype.trim.call as a callback for array methods, such as… Read more Can't Use String#trim As A Callback For Array#map