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

Javascript Proper Prototypical Inheritance

I've been spending my past couple hours researching prototypical inheritance, but I'm left … Read more Javascript Proper Prototypical Inheritance

Where The __proto__ Is Pointing When We Change The Prototype Of The Parent Object?

Normally when we create a new object using 'new' keyword, actually the __proto__ property o… Read more Where The __proto__ Is Pointing When We Change The Prototype Of The Parent Object?

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

Understanding Better Javascript Oop Architecture

As i read through some examples of Angularjs' UI add-on, i've stumbled over some code that … Read more Understanding Better Javascript Oop Architecture

How Can I Add Properties To An Object In Ie6?

I've got a particularly tricky problem using AJAX, which works fine in IE7 and Firefox, but not… Read more How Can I Add Properties To An Object In Ie6?

Javascript Build A Constructor Of Constructors

Here is a simple example of what I want : var ConstBuilder = function() { var constructor = fun… Read more Javascript Build A Constructor Of Constructors

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`?

What Is The Specific Impact Of Assigning __proto__ In Each Browser?

This is for a very specific use case. And this is all in typescript (which for this use case I thin… Read more What Is The Specific Impact Of Assigning __proto__ In Each Browser?

Javascript Unable To Access Same Object Method After Object.create(baseobject)

I am new to javascript. I have written some code by incorporating suggested answers. Now the code b… Read more Javascript Unable To Access Same Object Method After Object.create(baseobject)

In Javascript, The Difference Between 'object.create' And 'new'

I think the difference has clicked in my head, but I'd just like to be sure. On the Douglas Cro… Read more In Javascript, The Difference Between 'object.create' And 'new'

What Is In Object.__proto__?

In Google Chrom's javascript, objects have a property named __proto__ that points to their prot… Read more What Is In Object.__proto__?

Extending Knockout Viewmodels With Prototype

If a viewmodel is already defined, either manually or automatically with mapping plugin, is there a… Read more Extending Knockout Viewmodels With Prototype

Javascript Using Prototype How Can I Set The Value Of "this" For A Number?

So if we can get past the 'should you?' question ... does anyone know how to set the value … Read more Javascript Using Prototype How Can I Set The Value Of "this" For A Number?

Javascript: Prototype Attribute Not Visible On Parent

Example taken from here: http://sporto.github.io/blog/2013/02/22/a-plain-english-guide-to-javascrip… Read more Javascript: Prototype Attribute Not Visible On Parent

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?

Count Functions Calls With Javascript

For example: I have a lot of functions and use them many times. I need to count calls for each func… Read more Count Functions Calls With Javascript

Extending Object Literal

var x = { name: 'japan', age: 20 } x.prototype.mad = function() { alert('US… Read more Extending Object Literal

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

Object.defineproperty Or .prototype?

I've seen two different techniques of implementing non-native features in javascript, First is:… Read more Object.defineproperty Or .prototype?

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__?