Page 2

This page is using the info on javascript.info

  1. The triple equals symbol: === means equals. If two numbers are equal this is the sign.
  2. Code between curly braces is called a block.
  3. if 10 < 5 {
        // run some code here
    }

    This would not run the code because 10 is not less than 5.

  4. Another variation of the if is the if / else.
    if (43 < 2) {
        // Run the code in here
    } else {
        // Run a different bit of code
    }      
  5. Embedding variables into a a string

    Usually you can only have a string of text between it's open and closing quotes. However you can add a variable if you use backticks instead of quotes

    let name = "John";
    
    // embed a variable
    alert( `Hello, ${name}!` );
    
  6. Using Replace

    Replace is a function can be used to replace any string or part of a string. Type this into the console.

    let insult = 'u fuckin wanker';
    
    insult.replace('wanker', 'arsehole');
    
    u fuckin arsehole