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

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

Why Is `object() === New Object()` Equal To `false`?

Why it returns false? let a = new Object() let b = Object() console.log(a) // {} console.log(b) // … Read more Why Is `object() === New Object()` Equal To `false`?

Javascript Prototype Chain Self Reference

This question is about how javascript prototypes work. In particular I do not understand why in th… Read more Javascript Prototype Chain Self Reference

For-in Loop Vs In-operator

I consider myself a JS veteran but just now for the first time I have realised that the for ... in … Read more For-in Loop Vs In-operator

Javascript Prototype Accessing Another Prototype Function

function Scroller(id){ this.ID = id; this.obj = $('#'+id); this.currentSlide = … Read more Javascript Prototype Accessing Another Prototype Function

How To Do Prototypal Inheritance In Javascript?

I've tried several ways but I couldn't do it. On the next example I want the Soldier gets a… Read more How To Do Prototypal Inheritance In Javascript?

Why Does Typescript Mix The Module And Prototype Pattern?

I was having a look at the JS code generated by TypeScript on this page: http://www.typescriptlang.… Read more Why Does Typescript Mix The Module And Prototype Pattern?

Javascript Prototypal Inheritance?

I'been doing some inheritance in js in order to understand it better, and I found something tha… Read more Javascript Prototypal Inheritance?