A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/es/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN below:

Number.NaN - JavaScript | MDN

Number.NaN

Baseline Widely available

La propiedad Number.NaN representa Not-A-Number (No es numero). Equivalente de NaN.

Pruébalo
function clean(x) {
  // eslint-disable-next-line use-isnan
  if (x === Number.NaN) {
    // Can never be true
    return null;
  }
  if (isNaN(x)) {
    return 0;
  }
}

console.log(clean(Number.NaN));
// Expected output: 0

No tienes que crear un objeto Number para acceder a esta propiedad estática (usa Number.NaN).

Sobrescribir No Numerable No Configurable No Ejemplos Chequea si los valores son numericos
function sanitise(x) {
  if (isNaN(x)) {
    return Number.NaN;
  }
  return x;
}
Testing against NaN

See Testing against NaN on the NaN page.

Especificaciones Compatibilidad con navegadores Tambien mira

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4