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

Javascript "this" Losing Context In Ie

The following works fine in firefox/safari/chrome, in IE, 'this' appears to be losing conte… Read more Javascript "this" Losing Context In Ie

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

Extending Object Literal

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

Why Doesn't Any Object Prototype Work As A Foreach Callback?

Rather than a question, I just wanted it to be a challenge but couldn't find an answer yet. For… Read more Why Doesn't Any Object Prototype Work As A Foreach Callback?

Transposing A Javascript Array Efficiently

I wrote this method to transpose a javascript array Array.prototype.transpose = function () { le… Read more Transposing A Javascript Array Efficiently

Add A Rounding Method To Number.prototype In Javascript

How can I simplify rounding in JavaScript? I wish that I could do it in a more elegantly in an obje… Read more Add A Rounding Method To Number.prototype In Javascript

Node.js Change Number Object Value Inside Prototype

I want to add a new method to Number type, and then use it to change its own value. I write below c… Read more Node.js Change Number Object Value Inside Prototype

How To Use Prototype For Custom Methods And Object Manipulation

Honestly, I am trying to understand JavaScript prototypes and I'm not making much progress. I … Read more How To Use Prototype For Custom Methods And Object Manipulation

Why Is Reassigning Object.prototype Not Working?

Why this is not working? // this one works as I expected, when objSayHello() Object.prototype.objSa… Read more Why Is Reassigning Object.prototype Not Working?

What Is The Difference Between Array.function And Array.prototype.function?

I've found that some functions like concat() push() every() both exist in Array and Array.proto… Read more What Is The Difference Between Array.function And Array.prototype.function?

Javascript: Should I Be Hiding My Implementations?

As a C# programmer, I have a bit of a habit of making things private that can and should be private… Read more Javascript: Should I Be Hiding My Implementations?

Javascript Prototype Inheritance

This seems inconsistent, but probably is due to the fact that I'm new to javascript's proto… Read more Javascript Prototype Inheritance

Using Prototype Functions In Higher Order Functions In Javascript

I'm trying to concat an array of arrays using reduce and I figured that I could use the Array.p… Read more Using Prototype Functions In Higher Order Functions In Javascript

Using Javascript Prototype, Need To Dynamically Add Div Onclick

(I am studying prototype in javascript..) I need to dynamically add student details on a div and ke… Read more Using Javascript Prototype, Need To Dynamically Add Div Onclick

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

Messing With This In Prototype's Method

Ok, here's the situation: var vowels = ['a', 'i', 'y', 'e', … Read more Messing With This In Prototype's Method

How Should You Inherit From Eventemitter In Node?

I was reading over this small article to understand inheriting from EventEmitter, but I'm a lit… Read more How Should You Inherit From Eventemitter In Node?

Javascript Benchmarks In Testing Different Emulations Of A "class"

i have read articles that say: using the prototype will be fastest since functions declared are sh… Read more Javascript Benchmarks In Testing Different Emulations Of A "class"

What Methods/mixins Sequelize Adds To The Models When An Association Is Made?

While going through the sequelize docs, more specifically the documentations about associations, I … Read more What Methods/mixins Sequelize Adds To The Models When An Association Is Made?

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