Javascript is a high level, interpreted cross-platform programming language. It is used primarily for to create dynamic and interactive web pages. Can be integrated frontend and backend (NodeJS)
Compiled languages are converted directly converted into machine code (from source code to object code) that the processor can execute. C, C++, C#
Interpreted Languages are execute the code directly and line by line by an interpreter. The code does not need to be complied. JavaScript(V8 by google & SpiderMonkey by Mozilla ), PHP(zend engine), Python (CPython)
string, number, boolean, null, undefined, and symbol
Symbol is a unique, immutable and not convertible value that can be used to create unique identifiers for objects.
Visibility of a variable.
Functions that have access to the outer function's scope even after the outer function has finished execuing. They are useful for encapsulating private data.
A mechanism that allows JS handle asyncronous operations like setTimeout or fetching data without a service interruption. To do this, JS puts a callback function in a queue for every event.
When a function is called it is added to a Call Stack and when the function is done it is removed from the stack.
Set of functionalities for web browsers or web servers such as timer, fetcha api, ui events, DOM manupilations, push notification, web sockets and so on.
Stores callbacks for asynchronous operations that are ready to be executed. The callbacks are sent to the call stack using the FIFO principle.
Promise is an object to handle asynchronous processes that take some time like API calls, file loading etc. It contains pending, resolved and rejected stages. The pending stage is the stage where the process is running. The resolved means that the process was completed successfully, and the result was returned. The rejected means, the process, somehow, provide an error.
Destructing assignment is a JS expression that unpacks an object properties into variables.
- Regular functions get arguments by default.
- Arrow functions don't get arguments by default.
- In regular functions of an object or class 'this' represents the object.
- In arrow functions of an object or class 'this' does not represent the object.
- In event handlers the 'this' in a regular function represents the object of the event.
- In event handlers the 'this' in an arrow function represents the Window object.
A function that takes functions as arguments or returns functions as a result.
Event Delegation allows a single event handler attached to a parent to occur on the parent's all-defined children instead of attaching individual event listeners for every element. It helps to reduce memory usage and improve page loading performance.