Skip to content

solomonmulatu/Advanced-JavaScript-concepts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaScript Advanced Concept

This repository contains some advanced concepts of JavaScript that you may not know or use in your daily coding. These concepts include:

Closures:

A closure is a function that can access variables from an outer function scope, even after the outer function has returned. Closures are useful for creating private variables, partial applications, and currying.

Promises:

A promise is an object that represents the eventual completion or failure of an asynchronous operation. Promises allow you to write clean and concise code that handles asynchronous tasks without using callbacks or nested functions.

Async/Await:

Async/await is a syntactic sugar that makes working with promises easier and more readable. Async functions can use the await keyword to pause the execution until a promise is resolved or rejected. Await expressions can only be used inside async functions.

Generators:

A generator is a special kind of function that can be paused and resumed multiple times. Generators can yield values to the caller and receive values from the caller. Generators are useful for creating iterators, coroutines, and asynchronous streams.

Proxies:

A proxy is an object that wraps another object and intercepts its operations. Proxies can be used to modify the behavior of the target object, such as adding validation, logging, caching, or lazy loading. How to use this repository To use this repository, you need to have Node.js installed on your machine. You can download it from here.

To run the examples in this repository, you can use the following commands:

node closures.js to run the closure examples

node promises.js to run the promise examples

node async-await.js to run the async/await examples

node generators.js to run the generator examples

node proxies.js to run the proxy examples

You can also use an online editor like Replit to run the code in your browser.

How to contribute to this repository

If you want to contribute to this repository, you can follow these steps:

Fork this repository on GitHub

Clone your forked repository to your local machine

Create a new branch for your feature or bug fix

Make your changes and commit them with a descriptive message

Push your branch to your forked repository

Create a pull request from your branch to the original repository

Wait for feedback or approval from the maintainer

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published