“Przełącz boolean JS” Kod odpowiedzi

JavaScript przełącz zmienną

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

Przełącz boolean JS

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

toggleBool(false) //true
Noob Dev

Odpowiedzi podobne do “Przełącz boolean JS”

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu