- Zerodha -
-
Compiled vs Interpreted Language
- C++ is compiled language.
- JavaScript is interpreted language.
-
Strict vs Dynamic Languages
- type of the variable is strict
- Javascript is loosely typed language (dynamic nature).
-
Single Threaded nature of Javascript
- Executes one command at a time, in-order they are written.
-
Simple primitives
- Variables (var/let/const)
- Data types - Strings, numbers and booleans
- if/else
- Loops - For loop
-
Complex primitives
- Array
- Objects
- complex object
-
Functions
- reusable code
- callback function
- Strings
- length, indexOf, lastIndexOf, slice(0,5), subStr (deprecated), replace("",""), split(','), trim(), toUpperCase, toLowerCase
- Numbers
- parseInt, parseFloat
- Arrays
- push, pop, unshift, shit, concat, forEach
- callbacks, map, filter, reduce, find, sort
- Classes (Structure that is re-usable. A blueprint)
- attributes, functions
- static functions (associate with the class it self)
- Date
- JSON
- JSON.parse
- JSON.stringify
- Maths
- Objects
- Object.keys() -> Array of keys
- Object.values()
- Object.entries(obj)
- obj.hasOwnProperty('name')
- object.assign
- anonymous function
- passing function as argument
- Async functions
- web apis - setTimeout
- js engine architecture
- promise
- async/await