Back to Freecodecamp

Step 2

curriculum/challenges/english/blocks/workshop-logic-checker-app/690a51806fb743bc896c3af7.md

latest886 B
Original Source

--description--

As you learned in a previous lesson, booleans are a data type with only true and false values.

A truthy value is a value that evaluates to true in a boolean context. Examples of truthy values are:

  • Non-empty strings
  • Non-zero numbers
  • The boolean true

And other values you'll meet later on.

You can use the Boolean() function to check the truthiness of a value. For example, Boolean("Hello World!") will return true because "Hello World!" is truthy.

Now, call Boolean(truthyOrFalsy) and log the result to the console.

--hints--

You should log Boolean(truthyOrFalsy) to the console.

js
assert.match(__helpers.removeJSComments(code), /console\s*\.\s*log\s*\(\s*Boolean\s*\(\s*truthyOrFalsy\s*\)\s*\)\s*;?/);

--seed--

--seed-contents--

js
const truthyOrFalsy = true;
--fcc-editable-region--

--fcc-editable-region--