Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Boolean 3/4 | Data Types and Variables
Introduction to JavaScript (staging)
course content

Contenido del Curso

Introduction to JavaScript (staging)

Introduction to JavaScript (staging)

1. Introduction
2. JavaScript syntax
3. Data Types and Variables

Boolean 3/4

The <code class="go3679463865">Boolean()</code> Function:

The Boolean() function, in JavaScript, is used to return or convert a value to its Boolean value i.e., true or false.

Almost any value is evaluated as true if it has some sort of content, for example.

12
let name="paul"; console.log(Boolean(name));
copy

As you can see for the above variable, name we get the output as true because it had a string value. An empty string would have given a false output.

Tarea

Use the Boolean method to check wheater the value given to the variable emptyString is true or false. Show the answer on the console.

Tarea

Use the Boolean method to check wheater the value given to the variable emptyString is true or false. Show the answer on the console.

As you can see now for an empty string it gave the output as false.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones

¿Todo estuvo claro?

Sección 3. Capítulo 17
toggle bottom row

Boolean 3/4

The <code class="go3679463865">Boolean()</code> Function:

The Boolean() function, in JavaScript, is used to return or convert a value to its Boolean value i.e., true or false.

Almost any value is evaluated as true if it has some sort of content, for example.

12
let name="paul"; console.log(Boolean(name));
copy

As you can see for the above variable, name we get the output as true because it had a string value. An empty string would have given a false output.

Tarea

Use the Boolean method to check wheater the value given to the variable emptyString is true or false. Show the answer on the console.

Tarea

Use the Boolean method to check wheater the value given to the variable emptyString is true or false. Show the answer on the console.

As you can see now for an empty string it gave the output as false.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones

¿Todo estuvo claro?

Sección 3. Capítulo 17
toggle bottom row

Boolean 3/4

The <code class="go3679463865">Boolean()</code> Function:

The Boolean() function, in JavaScript, is used to return or convert a value to its Boolean value i.e., true or false.

Almost any value is evaluated as true if it has some sort of content, for example.

12
let name="paul"; console.log(Boolean(name));
copy

As you can see for the above variable, name we get the output as true because it had a string value. An empty string would have given a false output.

Tarea

Use the Boolean method to check wheater the value given to the variable emptyString is true or false. Show the answer on the console.

Tarea

Use the Boolean method to check wheater the value given to the variable emptyString is true or false. Show the answer on the console.

As you can see now for an empty string it gave the output as false.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones

¿Todo estuvo claro?

The <code class="go3679463865">Boolean()</code> Function:

The Boolean() function, in JavaScript, is used to return or convert a value to its Boolean value i.e., true or false.

Almost any value is evaluated as true if it has some sort of content, for example.

12
let name="paul"; console.log(Boolean(name));
copy

As you can see for the above variable, name we get the output as true because it had a string value. An empty string would have given a false output.

Tarea

Use the Boolean method to check wheater the value given to the variable emptyString is true or false. Show the answer on the console.

As you can see now for an empty string it gave the output as false.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
Sección 3. Capítulo 17
Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
We're sorry to hear that something went wrong. What happened?
some-alt