Javascript lets you compare unlike types without extra steps using ==. If you want strict comparison where “2” isn’t 2, use === and !==. Personally, I find that easier than having to parseint or cast every damn thing or whatever c does (strtol?). That said, I have build tools set up to enforce strict comparison because I don’t trust myself or others.
Javascript lets you compare unlike types without extra steps using ==. If you want strict comparison where “2” isn’t 2, use === and !==. Personally, I find that easier than having to parseint or cast every damn thing or whatever c does (strtol?). That said, I have build tools set up to enforce strict comparison because I don’t trust myself or others.