0% found this document useful (0 votes)
5 views2 pages

JavaScript Basics Cheat Sheet

This cheat sheet covers essential JavaScript concepts including loops (for, forEach, for...in, for...of), array methods (map, filter, reduce), and key features like event handling, the 'this' keyword, and asynchronous programming with Promises. It also explains closures and hoisting. These concepts are fundamental for understanding and writing JavaScript code effectively.

Uploaded by

sashidhr.k007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

JavaScript Basics Cheat Sheet

This cheat sheet covers essential JavaScript concepts including loops (for, forEach, for...in, for...of), array methods (map, filter, reduce), and key features like event handling, the 'this' keyword, and asynchronous programming with Promises. It also explains closures and hoisting. These concepts are fundamental for understanding and writing JavaScript code effectively.

Uploaded by

sashidhr.k007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

JavaScript Basics - Simple Cheat Sheet

for loop
Repeats a block of code a set number of times using a counter.

forEach
Runs a function once for every item in an array.

for...in
Loops through the keys (property names) in an object.

for...of
Loops through the values of an array or iterable.

map()
Creates a new array by changing each element of the original array.

filter()
Creates a new array with items that meet a certain condition.

reduce()
Combines all values in an array into a single result.

Array Destructuring
Easily unpacks values from an array into variables.

Events
Things that happen on a webpage like clicking or typing.

Event Handling
Running code in response to an event happening.

this keyword
Refers to the object that is currently executing the function.

Synchronous
Code runs line by line; each step waits for the previous one.

Asynchronous
Code runs in the background without stopping other code.

Promise
Handles tasks that finish later (like loading data).
resolve
Used in a Promise when the task completes successfully.

reject
Used in a Promise when the task fails or has an error.

async/await
Lets you write async code that looks like regular code.

Closures
A function that remembers variables from its outer function.

Hoisting
JavaScript moves declarations to the top before running the code.

You might also like