Simple question about the efficiency of $().addClass
Reading through the jQuery uncompressed code, I noticed a lot of functions have the "proceed" validation variable. Specifically I'm looking at the addClass function:
- proceed = typeof value === "string" && value;
Wouldn't doing a null check first be more efficient? If it were null wouldn't it return false on the first check instead of doing at least two checks?
- proceed = value && typeof value === "string";