JAVASCRIPT

  minte9
REMEMBERS




Last update:   11-01-2022

Statements

Statements are syntax constructs and commands that perform actions.
 
/**
 * Between statements the semicolon can be omitted, but ...
 * it is recommended to put semicolons every time.
 * Javascript does not assume a semicolon before square brackets.
 */
console.log("Hello");
console.log("World");
    // Hello
    // World

console.log(1 + 
    2 + 
    3
); // 6

console.log("There will be an error") // Look here - no semicolon
    // There will be an error

[1, 2].forEach(console.log); 
    // Uncaught TypeError: Cannot read property

Comments

In most editors, you can comment out by pressing the Ctrl + /
 
/**
 * One-line comments start with two forward slash characters //
 * Multiline comments start with a forward slash and an asterisk /*
*/
 
// one line comment
console.log('Hello');

/**
 * Multi line comment
 */
 console.log('World');

Questions     github Fundamentals
Use strict
        A B C D E F
🔔
1/2