I read the following tutorial for re-introduction to JavaScript:
A re-introduction to JavaScript (JS tutorial) - JavaScript
🐰 Introduction
JavaScript was created in 1995 by Brendan Erich, who worked at Netscape.
It was originally called LiveScript at first, but it was renamed to JavaScript after an ill-fated marketing decision.
👽 Overview
JavaScript’s diagram looks like this:
- Number
- String
- Boolean
- Symbol (new in Edition 6)
- Object
- Function
- Array
- Date
- RegExp
- Null
- Undefined
- Error (Built-in)
🎉 Number
Numbers in JavaScript are “double-precision 64-bit format IEEE 754 values.”
0.1 + 0.2 // 0.30000000000000004 |
You can convert a string to an integer using the built-in parseInt() function.
In old browsers strings beginning with a “0” are assumed to be octal (radix 8), but this hasn’t been the case since 2013.
// Modern browsers: |
A special value called NaN (short for “Not Number”) is returned:
parseInt("hello", 10); // NaN |
JavaScript also has the special values Infinity and -Infinity:
1 / 0; // Infinity |
😼 Boolean
Any value can be converted to a boolean according to the following rules:
- false, 0, empty strings (“”), NaN, null, and undefined all become false.
- All other values become true.
Examples of Boolean() function as follows:
Boolean(""); // false |
Boolean operations such as && (logical and), || (logical or), and ! (logical not) are supported.
So, we don’t frequently need to use it.
🎃 Operator
// + operator |
🗻 Functions
function add(x, y) { |
function add() { |
function Person(first, last) { |
🐞 Add a method to String by the prototype of built-in JavaScript
var s = "Simon"; |
🖥 Recommended VPS Service
VULTR provides high performance cloud compute environment for you.
Vultr has 15 data-centers strategically placed around the globe, you can use a VPS with 512 MB memory for just $ 2.5 / month ($ 0.004 / hour).
In addition, Vultr is up to 4 times faster than the competition, so please check it => Check Benchmark Results!!