- Fork this repository to start a new project in your repos folder == git clone <JavaScript_Operators>
- cd JavaScript_Operators to navigate into your new repo directory
- Type the command code . to open VSC with the JavaScript_Operators folder
- Open the app.js file
- Declare 2 variables,
aandb, and assign 20 toaand 4 tob - Declare a variable
addthat uses the+operator to store the result of adding the values stored inaandb - Declare a variable
minusthat uses the-operator to store the result of subtracting the values stored inaandb - Declare a variable
multiplythat uses the*operator to store the result of multiplying the values stored inaandb - Declare a variable
dividingthat uses the/operator to store the result of dividing the values stored inaandb
You can print the value of the variables to the browser console (ex: console.log(add)) to check the result.
- Use the following code to answer the questions below:
let a = 11;
let str = "11";
let str2 = "eleven";
let isPresent = true;
let firstName = "Jackie";
let lastName = "Chan";
- What is the value of: a + str? 1111
- What is the value of: a + str2? 11eleven
- What is the value of: a + isPresent? 12
- What is the value of: a + firstName? 11Jackie
- What is the value of: a + lastName? 11Chan
Use the code above to test and print the results.
- Use the following code to answer the questions below:
let a = 5;
let str = "5";
let str2 = "five";
let isPresent = false;
let firstName = "Robin";
let lastName = "Williams";
- What is the value of: a == str? True
- What is the value of: a === str? False
- What is the value of: !isPresent? True
- What is the value of: (“eleven” == str2 && a >= str)? False
- What is the value of: (!isPresent || isPresent)? True
- What is the value of: 0 == false? Yes
- What is the value of: 0 === false? No
- What is the value of: 0 != false? Yes
- What is the value of 0 !== false? Yes
Use the code above to test and print the results.