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

What's Wrong With A Javascript Class Whose Constructor Returns A Function Or An Object

When I use new to instainciate an instance of a certain class, I got the actual instance. When the … Read more What's Wrong With A Javascript Class Whose Constructor Returns A Function Or An Object

Best Way To Create A New Constructor That Relies On An Old One Using Prototypes

So, suppose I have the following constructor function, whose prototype I have modified like so: fun… Read more Best Way To Create A New Constructor That Relies On An Old One Using Prototypes

How To Map An Object Literal To Be An Instance Of My Constructor Function?

I have a constructor function like below: var Person = function (name, age) { this.name = name;… Read more How To Map An Object Literal To Be An Instance Of My Constructor Function?

Can You Create Functions With Custom Prototypes In Javascript?

First of all, I don't want to add methods to Function.prototype. Doing that would make them ava… Read more Can You Create Functions With Custom Prototypes In Javascript?

How To Overwrite Addeventlistener In Firefox 3.x?

im making a greasemonkey userscript which puts all kinds of shims and polyfills in the page for old… Read more How To Overwrite Addeventlistener In Firefox 3.x?

Extending Object Literal

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

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

"value Below Was Evaluated Just Now", What Does It Mean?

Folks! I am trying to list down what happens behind the scenes when new keyword is used to create a… Read more "value Below Was Evaluated Just Now", What Does It Mean?