Evaluate some complex expressions of JavaScript

The answer pattern should be step by step

check the PDF attachment

The questions as follows

  1. true || false && true
  2. let firstName = “trouble”; let lastName = “double”; (firstName === “Batman” || firstName === “Trouble”) && (lastName === “Batman” || lastName === “kong” )
  3. let a = 21;

a += 3;

let b = 5;

b -= a;

(a < 1) || (b >= 1) && (a != b)

  1. let pet = “alligator”; let escape = “boat”; “The “ + pet + “ escaped. It was last seen on a “ + escape;
  2. let George = “orge”; let nickname = “Conquerer”; let combinedName = George + “ “ + nickname;
  3. ((42 === “42”) && (42== “42”)) || ((42 < “Whistle”) || (42 > “234”))
  4. ((24*23+12/2+22) % 2 === 1)
  5. ((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)
  6. let sentence = “The world is green!”;
  7. 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

This question has been answered.

Get Answer