GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing es.javascript.info — if (un string con cero)

  • Tutorial
  • El lenguaje JavaScript
  • Fundamentos de JavaScript
  • Ejecución condicional: if, '?'
regresar a la lección

if (un string con cero)

importancia: 5

Se mostrará el alert?

if ("0") {
  alert( 'Hello' );
}

Sí lo hará.

Cualquier string excepto uno vacío (y "0" que no es vacío) se convierte en true en un contexto lógico.

Podemos ejecutar y verificar:

if ("0") {
  alert( 'Hola' );
}
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.