TODO: check internet connection
Learn Intermediate JavaScript https://www.codecademy.com/profiles/Khanh.Le Learn Asynchronous JavaScript https://www.codecademy.com/profiles/Khanh.Le/certificates/705dcb15de0da4dd9d9fc4f3274b430e Learn JavaScript Course
let // define variable values block scope vs var global, function scope
= : assigned Value
== or === : implicit check just value, strict equality type and value
initialization: declare and assign value
let aVar = "value A";
const PI = 3.14; // declare a constant, does not change, must initialize
const obj = {f: 'f1'};
obj = ...; // error
obj.f = ...; // ok
string, number, bigint, boolean, undefined, and symbol
template literals
`PI: ${PI}`;
function funcA(){ ... }
setTimeout(funcA, 500); // how to use function with params => anonymous function, arrow function
setTimeout(function(){....}, 500);
setTimeout(() => {....}, 500);
! : logical not
const anArray = [1,2,3];
anArray.push(4);
const len = anArray.length;
delete anArray[2]; // undefined, remove value at index 2, index starts from 0
anArray.splice(2, 1); // from index 2 remove 1 item
for (var i=0; i<len; i++){...}
while(true){...} // remmber to break
anArray.forEach(item => {});
anArray.forEach((item, index) => {}); // cannot add break statement
anArray.find(item => item === "some value")
anArray.filter(item => item.keyN === "some value") // what different from .find()
anArray.some(item => item.keyN === "some value") // return boolean check
anArray.map(item => { item.keyM = "some value"; return item;})
anArray.reduce((sum,curr) => sum += curr, 0)
Promise
class A extends B {
constructor(p){
super(p);
}
}
export/import
https://www.codecademy.com/paths/pass-the-technical-interview-with-javascript/tracks/getting-started-with-data-structures-js/modules/intro-to-js-data-structures-and-algorithms/articles/data-structure-apis-js
https://www.codecademy.com/paths/create-a-back-end-app-with-javascript/tracks/bapi-javascript-fundamentals/modules/intro-to-javascript-for-apis/lessons/introduction-to-javascript/exercises/console
https://www.codecademy.com/paths/create-video-games-with-phaser/tracks/game-dev-learn-javascript-basics/modules/game-dev-learn-javascript-basics/lessons/introduction-to-javascript/exercises/console
https://codelabs.developers.google.com/codelabs/community-visualization/index.html?index=..%2F..index
https://www.codecademy.com/learn/asynchronous-javascript
https://www.codecademy.com/learn/javascript-errors-debugging
https://www.codecademy.com/learn/learn-javascript-unit-testing
https://www.codecademy.com/learn/build-interactive-websites
https://www.codecademy.com/learn/learn-jquery
JavaScript Design Patterns => https://app.pluralsight.com/score
.map() over .forEach()
JSON
{
"status": 200,
"statusText": "OK"
"message": "Meaning of the response",
"data": [
{
"id": 1,
"name": "Text 1"
}
]
}
expression: a.length()
statement: let a = '1'
document.getElementById('textId').defaultValue; // = 'init';