JavaScript Cheatsheet
HTML
- De facto programing language of the web.
- Adds interactivity to your website.
- Versatile and beginner-friendly.
Fundamentals
- JavaScript programs can be inserted into an HTML document using the script tag
- Variables store values. You declare a variable with the let keyword, followed by the name you give to the variable
- A semicolon at the end of a line indicates where a statement ends.
Arrays
- An array is a special variable, which can hold more than one value
- JavaScript arrays are resizable and can contain a mix of different data types.
- JavaScript arrays are zero-indexed: the first element of an array is at index 0
Loops
- Loops offer a quick and easy way to do something repeatedly
- There are many different kinds of loops, but they all essentially do the same thing
- The various loop mechanisms offer different ways to determine the start and end points of the loop
Functions
- A function is a block of code designed to perform a particular task
- A function is executed when "something" invokes it (calls it).
- A JavaScript function is defined with the function keyword, followed by a name, followed by parentheses ().
ES6
- JavaScript ES6 is the newer version of JavaScript that was introduced in 2015
- ES6 stands for ECMAScript 6
- Some features are: Let,Const,Default Paramaters, Template Literals,Arrow Functions, Promises,Destructuring