html - Javascript Freecodecamp "Do not use a Boolean as a Constructor" -


i have small problem when started "falsy bouncer" challenge on free code camp. when try create new boolean object below:

var bool = new boolean(); 

a yellow triangle appears , says "do not use boolean constructor".

i go around , not use object, or use different methods says in boolean object documentation , challenge not difficult don't know why cannot create new object inside freecodecamp code window? outside or inside function , or whithout parameters.

does 1 know why happens?

from mdn ~

do not use boolean object convert non-boolean value boolean value. instead, use boolean function perform task:

var x = boolean(expression);     // preferred  var x = new boolean(expression); // don't use 

Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -