- OBJECTS
- Basics
- Reference
- Methods
- Constructor
- FUNDAMENTALS
- Hello World
-
Code Structure
- Use Strict
- Variables
- Data Types
- Type Conversions
- Maths
- Comparitions
- Conditional
- Loops
- Functions
- TESTING
- Mocha
- Nested Describe
- TYPES
- Primitives
- Numbers
- Strings
- Arrays
- Json
- DESIGN PATTERN
- Observer Pattern
- CLASSES
- Constructor
- Binding
- Inheritance
Statements
Statements are syntax constructs and commands that perform actions.
/**
* Semicolon can be omitted, but not recommended
* A semicolon is not assume before square brackets
*/
console.log("Hello"); // Hello
console.log("World"); // World
console.log(1 + // 6
2 + 3
);
try {
console.log("abc") // Look Here
[1, 2].forEach(console.log);
} catch (err) {
console.log(err.name); // TypeError
}
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 /*
*/
console.log('Hello'); // one line comment
Last update: 531 days ago