It's generally considered a best practice in JS to use === instead of == in nearly all cases: it looks like you're safe in this case, but the double equals can lead to really weird and unpredictable results because it tries to perform type coercion before comparing when possible. There's a good explanation and some OH JAVASCRIPT, SO WACKY!! examples here: http://www.impressivewebs.com/why-use-triple-equals-javascipt/