“Alternar booleano JS” Respostas de código

JavaScript alternam variável

var thing = true; //try changing this to false
thing = !thing; //the variable will go from true to false, or from false to true
The Amateur

Alternar booleano JS

const toggleBool = (val) => (val = !val)

toggleBool(false) //true
Noob Dev

Respostas semelhantes a “Alternar booleano JS”

Procure respostas de código populares por idioma

Procurar outros idiomas de código