Practice Modern JavaScript
vaScript using async
A boilerplate to setup and practice Modern JavaScript
1. Install nodemon globally for watching for file changes while running the code ? ?
$ npm install -g nodemon # npm i -g nodemon2. Install all dependencies ? ?
$ yarn install1. Start watching for file changes ?
$ yarn run watch # yarn start2. Start writing modern JavaScript in src/index.js file
// my-module.js
export const name = 'My Module'// index.js
import * as myModule from './my-module'
console.log(myModule.name) // 'My Module'3. Enjoy the output ?
$ yarn start
My Module1. Example 1 ⮭
// async-await.js
const prom = new Promise(resolve => {
resolve(`Hello`)
})
const longRun = async () => {
const res = await prom
console.log(res)
}
longRun()2. Example 2 ⮭
// array-includes.js
const includes3 = [1, 3, 4].includes(3)
console.log(includes3)Abhisek Pattnaik ? |
|---|
This project follows the all-contributors specification.
All types of Contributions are Welcome
MIT © Abhisek Patnaik
Tweet @abhisek
Know about/abhisekp
Chat with
@abhisekp