hasownproperty

My dilemma involving JavaScript's Prototypal Inheritance and the hasOwnProperty method

Basically everyone writing about member enumeration in JavaScript heavily advocates the use of the hasOwnProperty method as to avoid going up the prototype-chain. I understand that this is a form of defensive programming as to prevent iterating over members that are added, for example, to the Object.prototype. But what about the other...

How to bind functions to the JSON object?

function Person(_name, _id, _salary){ this.Name = _name; this.Id = _id; this.Salary = _salary; } Person.prototype.f_IncreaseSalary = function( _percentage ){ this.Salary *= _percentage; } var per = new Person("cem",10,15000); 1) I can access to per.f_IncreaseSalary(0.2) but what if i create this object from JSON strin...