Just a heads up == vs ===. == handles any type conversion, === will be false if it's a different type. (It's should always work the way you have it, but just wanted to let you know). 
So for ex:
"a" == new String("a") // true
"a" === new String("a") // false