falsy values in javascript with examples using VS Code

Pubblicato il: 11 gennaio 2023
sul canale di: Tech Nursery
19
1

By watching this video you will understand what are the falsy values in javascript and How falsy values work in javascript

In order to explain it clear i have discussed about truthy values in javascript also.For better understanding,i used if else statement with truthy and falsy values

Javascript falsy values

1. Zero 0
2. Negative Zero -0
3. Bigint Zero 0n
4. Empty String "" and ''
5. null
6. undefined
7. NaN
8. false

Some of the javascript truthy values

" ", ' ', "0", 1, 'Technursery'


I will share the entire code below

//coerced to false
0, -0, 0n, "",'', null, undefined,NaN,false

//coerced to true
" ", ' ', "0", 1, 'Technursery'
if(1234){
console.log('I am truthy value')
}else{
console.log('I am falsy value')
}


In questa pagina del sito puoi guardare il video online falsy values in javascript with examples using VS Code della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Tech Nursery 11 gennaio 2023, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 19 volte e gli è piaciuto 1 spettatori. Buona visione!