If you ever had the need to compare two javascript object you know that this is not an easy task. Javascript compare objects by reference, so only if it is the same object the javascript compare will return true. The Problem The simple solution to compare two object is to iterate on the properties and [...]
In one of the projects that I’m working on I had to setup a property of an object in a general way. In order to do so, i wrote the following function: function setValue(key,value,obj){ obj[key.toString()] = value; } so calling the functuion like so var obj = { a:1,b:2,c:3 }; setValue( "a" , 2 , [...]