Skip to content

Instantly share code, notes, and snippets.

@katemalone
Last active November 13, 2019 19:34
Show Gist options
  • Save katemalone/ac178281b5b66b63897a1fd1a7b9404f to your computer and use it in GitHub Desktop.
Save katemalone/ac178281b5b66b63897a1fd1a7b9404f to your computer and use it in GitHub Desktop.
Vanilla JavaScript Review
  • In JavaScript, the console keyword refers to an object, a collection of data and actions, that we can use in our code.

  • Keywords are words that are built into the JavaScript language, so the computer will recognize them and treats them specially.

  • One action, or method, that is built into the console object is the .log() method. When we write console.log() what we put inside the parentheses will get printed, or logged, to the console.

  • primitive data types

    • booleans
    • undefined
    • numbers
    • null
    • strings
  • complex data types

  • objects
  • functions

Arithmetic Operators

An operator is a character that performs a task in our code. JavaScript has several built-in in arithmetic operators, that allow us to perform mathematical calculations on numbers.

These include the following operators and their corresponding symbols:

  1. Add: +
  2. Subtract: -
  3. Multiply: *
  4. Divide: /
  5. Remainder: %

Operators aren't just for numbers. When + operator is used on two strings it appends the left string to the right string' The process of appending one string to another is called concatenation.

The . is another operator! We call it the dot operator.

We call or use methods by appending an instance with a period or the dot operator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment