Number.isNaN() is unsupported by IE and Safari

window.isNaN() is more portable.