Boolean Values

Understanding Boolean Values

Another data type is the Boolean. Booleans may only be one of two values: true or false.

Note: Boolean values are never written with quotes. The strings “true” and “false” are not Boolean and have no special me…


This content originally appeared on DEV Community and was authored by Randy Rivera

Understanding Boolean Values

Another data type is the Boolean. Booleans may only be one of two values: true or false.

Note: Boolean values are never written with quotes. The strings "true" and "false" are not Boolean and have no special meaning in JavaScript.

  • Example:
function welcomeToBooleans() {
  return true;
}
welcomeToBooleans(); // will display true

function welcomeToBooleans() {
 return false; 
}
welcomeToBooleans(); // will display false


This content originally appeared on DEV Community and was authored by Randy Rivera


Print Share Comment Cite Upload Translate Updates
APA

Randy Rivera | Sciencx (2021-04-18T16:11:21+00:00) Boolean Values. Retrieved from https://www.scien.cx/2021/04/18/boolean-values/

MLA
" » Boolean Values." Randy Rivera | Sciencx - Sunday April 18, 2021, https://www.scien.cx/2021/04/18/boolean-values/
HARVARD
Randy Rivera | Sciencx Sunday April 18, 2021 » Boolean Values., viewed ,<https://www.scien.cx/2021/04/18/boolean-values/>
VANCOUVER
Randy Rivera | Sciencx - » Boolean Values. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/04/18/boolean-values/
CHICAGO
" » Boolean Values." Randy Rivera | Sciencx - Accessed . https://www.scien.cx/2021/04/18/boolean-values/
IEEE
" » Boolean Values." Randy Rivera | Sciencx [Online]. Available: https://www.scien.cx/2021/04/18/boolean-values/. [Accessed: ]
rf:citation
» Boolean Values | Randy Rivera | Sciencx | https://www.scien.cx/2021/04/18/boolean-values/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.