News for hackers. Stuff that matters.
Re:Search: .lenght - Github by amirhhz on Saturday January 14, 2012 @01:47PM (#3464900)
In JavaScript, if you check for a non-existent property on a variable (e.g. aVar.lenght vs aVar.length) it will return "undefined". So people often rely on this behaviour to check if something is an array or not (no comment on whether this is good or bad), with:

    if(somethingThatMightBeAnArray.length){
        // do things with array
    }
So misspelling of length can be making a lot of code out there behave in an unexpected way.
Re:Search: .lenght - Github by jpeterson on Saturday January 14, 2012 @02:42PM (#3465081)
The same pattern is widely used to test whether an array-like object is empty. Since a length of 0 is also "falsey", it evaluates as false when the array has no elements. A typo in this case would result in the tested array always being "empty".
Re:Search: .lenght - Github by thousande on Saturday January 14, 2012 @02:23PM (#3465008)
That is a bad thing as String also have a length property

"bar".length; // 3