|
|
|
|
|
by amirhhz
5264 days ago
|
|
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. |
|