Adarsh Gupta⚑
Adarsh Gupta⚑

@Adarsh____gupta

23 Tweets 6 reads Oct 22, 2022
The Complete JavaScript Guide for beginners.
17+ topics
5+ cheatsheets
Unlimited Values
A detailed thread( & Drop πŸš€ for PDF version)πŸ§΅πŸ‘‡πŸ»
JavaScript is a multi-paradigm, dynamic, high-level, loosely typed language.
We use JavaScript to create
β€’ websites
β€’ Mobile applications
β€’ web applications
β€’ server-side applications using Node.js
β€’ smartwatch applications
1. Variable
A variable is a value assigned to an identifier, so you can reference and use it later in the program.
We use the following keywords to declare variables:
β€’ let
β€’const
β€’var
2. Types
Two types of types in JavaScript:
β€’ Primitive types
β€’ object types
Primitive types: numbers, strings, booleans.
Object types: numbers, strings, booleans(if defined with the new keyword)
3. Operators
β€’ Addition +
β€’ Subtraction -
β€’ Multiplication *
β€’ Division /
β€’ modulus %
β€’ Exponential **
Comparison operators
<, >, <=, >=,==, ===, !==
4. Conditionals
β€’ if(true){ condition}
Loops
β€’ While loop: while(true){}
β€’ For Loop: for(s1,s2,s3){//statements}
β€’ Do while: do{}while(true)
5. Complete loop guide
6. Arrays
An array is a collection of similar data elements stored at contiguous memory locations
const array=[1,2,3]
Array Operations
push() : Add to array
pop() : remove from array
concat() : join 2 arrays
7. Hoisting
When developers are unclear about the concept of hoisting in JavaScript, they frequently encounter unexpected outcomes. Before the execution of the code, the interpreter appears to move the declaration of functions, variables, or classes to the top of their scope.
8. Functions
Lines of code for doing a specific task
9. Arrow functions
They allow you to write functions with a shorter syntax
,
10. Complete functions Cheatsheet
11. Scope
Scope defines whether you can access or reference a particular value or expression. We are unable to use a declared variable if it is not included in the current scope. This idea is crucial to understand because it makes it easier to separate logic in your code.
In JavaScript, we have 3 types of scopes:
Global scope: Variables and expressions can be referred to anywhere in a global scope. This is the default scope.
Local scope: Variables and expressions can be referenced only within the boundary.
12. Objects
Any value that's not of a primitive type & is always passed by reference.
13. Classes
Class methods are created with the same syntax as object methods. Use the keyword class to create a class.
Classes are a template for creating objects.
14. Callbacks
A callback is a function that is passed as an argument to another function, and its execution is delayed until that function to which it is passed is executed.
15. Promises
A promise is an object that has the potential to produce only one value in the future: either a resolved value or an explanation for why it cannot be resolved (such as a network error).
There are three possible states for a promise: fulfilled, rejected or pending
16. Asynchronous JavaScript
Asynchronous JavaScript has never been easy. We have used callbacks for a while. Then, we employed promises. We use asynchronous functions most of the time now.
17. Closure
It is a feature in JavaScript where an inner function has access to the outer function’s variables
The inner function can access the variables defined in its scope, the scope of its parent functions, or even its grandparent functions & the global variables
This Guide took several hours to Create and several resources have been referenced
If you find this Guide useful, RETWEET and spread the word(1000+ Retweets and I will create the best FREE Visual Ebook for JavaScript)
Do Like it if you Like it
Bookmark this and Drop your valuable comments here: πŸ˜‹
Hey I'm Adarsh I post content on
✭ Web development
✭ JavaScript
✭ ReactJS and more
Follow @adarsh____gupta for more
A complete PDF for this is available here.
You can buy it or DM for the FREE Coupon.
adarshgupta.gumroad.com

Loading suggestions...