I needed to create an algorithm which will (efficiently) take an old array and a new array and give me back the changes between the two (which items added, which removed). It ha
There is no undefined constant. You should check the type of the variable instead:
if (typeof o === 'undefined') o = [];
Edit:
As Tim Down showed, the property is actually defined in the standard, but as the standard doesn't define it to be constant, it's unreliable and should not be used.