- Javascript
- 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: 61 days ago