Evaluate some complex expressions of JavaScript
The answer pattern should be step by step
check the PDF attachment
The questions as follows
- true || false && true
- let firstName = âtroubleâ; let lastName = âdoubleâ; (firstName === "Batman" || firstName === "Trouble") && (lastName === "Batman" || lastName === "kong" )
- let a = 21;
a += 3;
let b = 5;
b -= a;
(a < 1) || (b >= 1) && (a != b)
- let pet = âalligatorâ; let escape = âboatâ; âThe â + pet + â escaped. It was last seen on a â + escape;
- let George = âorgeâ; let nickname = âConquererâ; let combinedName = George + â â + nickname;
- ((42 === "42") && (42== "42")) || ((42 < "Whistle") || (42 > "234"))
- ((24*23+12/2+22) % 2 === 1)
- ((Math.pow(3,3) === 27) || (Math.cos(Math.PI) === 0)) || (Math.pow(Math.sin(1.2),1)+Math.pow(Math.cos(1.2),2) === 1)
- let sentence = âThe world is green!â;
- let bigCar = true;
(combinedName === George) || (George !== "George") &&(combinedName === "Conquerer") || (nickname === 42)
sentence.substring(4,9) === "world" && sentence.length < 20 && sentence.length > 5 && sentence.substring(0,3) === "The world is red".substring(0,3);
let bearTrap; "The variable bigCar has the value : "+ bigCar + ", while variable bearTrap is " + bearTrap + "If I compare bearTrap with undefined I get " + bearTrap===undefined
Sample Solution