Git Product home page Git Product logo

javascript_operators's Introduction

JavaScript_Operators

Steps

  1. Fork this repository to start a new project in your repos folder => git clone <JavaScript_Operators>
  2. cd JavaScript_Operators to navigate into your new repo directory
  3. Type the command code . to open VSC with the JavaScript_Operators folder
  4. Open the app.js file

Exercise 1

  1. Declare 2 variables, a and b, and assign 20 to a and 4 to b
  2. Declare a variable add that uses the + operator to store the result of adding the values stored in a and b
  3. Declare a variable minus that uses the - operator to store the result of subtracting the values stored in a and b
  4. Declare a variable multiply that uses the * operator to store the result of multiplying the values stored in a and b
  5. Declare a variable dividing that uses the / operator to store the result of dividing the values stored in a and b

You can print the value of the variables to the browser console (ex: console.log(add)) to check the result.

Exercise 2

  1. Use the following code to answer the questions below:
let num = 11;
let str = "11";
let str2 = "eleven";
let isPresent = true;
let firstName = "Frodo";
let lastName = "Baggins";
  • What is the value of: num + str?
  • What is the value of: num + str2?
  • What is the value of: num + isPresent?
  • What is the value of: firstName + num?
  • What is the value of: isPresent + str?
  • What is the value of: firstName + lastName?

Use the code above to test and print the results.

Exercise 3

  1. Use the following code to answer the questions below:
let val = 5;
let str3 = "5";
let str4 = "five";
let isAwake = false;
  • What is the value of: val == str3?
  • What is the value of: val === str3?
  • What is the value of: !isAwake?
  • What is the value of: ("eleven" == str4 && val >= str3)?
  • What is the value of: (!isAwake || isAwake)?
  • What is the value of: 0 == false?
  • What is the value of: 0 === false?
  • What is the value of: 0 != false?
  • What is the value of 0 !== false?

Use the code above to test and print the results.

javascript_operators's People

Contributors

bryantellius avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.