true + true javascript
snippet in javascript

true + true javascript

user7056

//booleans are converted to numbers before addition takes place

console.log(true + true); // 2

javascript boolean

user2755


var x = false;

var y = new Boolean(false);


 //
typeof x returns boolean

 //
typeof y returns object