I need a function:
function isSame(a, b){ }
In which, if a and b are the same, it returns true. , I tried return a === b, b
return a === b
You could embed Underscore.js and use _.isEqual(obj1, obj2). The function works for arbitrary objects and uses whatever is the most efficient way to test the given objects for equality.