dorey / JavaScript-Equality-Table

Creative Commons Attribution Share Alike 4.0 International
1.24k stars 193 forks source link

White space #15

Open rossmills99 opened 9 years ago

rossmills99 commented 9 years ago

Something that I came up against recently, whitespace compared for equality with 0 resolves to true. It's not the same as an empty string because empty string and white space don't compare equally with empty array for example. So I think white space could legitimately be included in the table.

'\n\t ' == 0 true '\n\t ' == [] false '' == [] true