Skip to content

Latest commit

 

History

History

0x00-ES6_basic

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

📖 0x00. ES6 Basics

Topics Covered

  1. ECMAScript 6 - ECMAScript 2015.
  2. Node.js and NPM

Project setup

# Create a new node project
npm init -y

# Install babel core for project
npm install --save-dev @babel/core

# Add babel presets (babel plugins and config options)
npm install --save-dev @babel/preset-env

# Create babel config file
touch babel.config.js

# Install babel-node for project
npm install --save-dev @babel/node

# Run js file using babel node
npx babel-node <js filename>

# Run js file using package.json script
npm run dev <filename>

# Install eslint for liniting js file
npm install --save-dev eslint

# Setup eslint configuration
npx eslint --init # or
npm init @eslint/config

# Lint a folder with js file or lint a js file.
npx eslint <folder | filename>

# Fix a js file lint issue
npx eslint <folder | filename> --fix

# Install Jest as development dependecy.
npm install --save-dev jest
npm uninstall --save-dev jest

npm install --save-dev [email protected]

# Run jet test
npm run test

# Install @babel/jest
# npm install --save-dev babel-jest
# npm uninstall --save-dev babel-jest

💻 Tasks

touch 0-constants.js
chmod +x 0-constants.js
npm run lint 0-constants.js --fix

touch 0-main.js
chmod +x 0-main.js
npm run dev ./tests/0-main.js 
touch 1-block-scoped.js
chmod +x 1-block-scoped.js
npm run lint 1-block-scoped.js --fix

touch ./tests/1-main.js
chmod +x ./tests/1-main.js
npm run dev ./tests/1-main.js 
touch 2-arrow.js
chmod +x 2-arrow.js
npm run lint 2-arrow.js --fix

touch ./tests/2-main.js
chmod +x ./tests/2-main.js
npm run dev ./tests/2-main.js 
touch 3-default-parameter.js
chmod +x 3-default-parameter.js
npm run lint 3-default-parameter.js --fix

touch ./tests/3-main.js
chmod +x ./tests/3-main.js
npm run dev ./tests/3-main.js 
touch 4-rest-parameter.js
chmod +x 4-rest-parameter.js
npm run lint 4-rest-parameter.js --fix

touch ./tests/4-main.js
chmod +x ./tests/4-main.js
npm run dev ./tests/4-main.js
touch 5-spread-operator.js
chmod +x 5-spread-operator.js
npm run lint 5-spread-operator.js --fix

touch ./tests/5-main.js
chmod +x ./tests/5-main.js
npm run dev ./tests/5-main.js
touch 6-string-interpolation.js
chmod +x 6-string-interpolation.js
npm run lint 6-string-interpolation.js --fix

touch ./tests/6-main.js
chmod +x ./tests/6-main.js
npm run dev ./tests/6-main.js
touch 7-getBudgetObject.js
chmod +x 7-getBudgetObject.js
npm run lint 7-getBudgetObject.js --fix

touch ./tests/7-main.js
chmod +x ./tests/7-main.js
npm run dev ./tests/7-main.js
touch 8-getBudgetCurrentYear.js
chmod +x 8-getBudgetCurrentYear.js
npm run lint 8-getBudgetCurrentYear.js --fix

touch ./tests/8-main.js
chmod +x ./tests/8-main.js
npm run dev ./tests/8-main.js
touch 9-getFullBudget.js
chmod +x 9-getFullBudget.js
npm run lint 9-getFullBudget.js --fix

touch ./tests/9-main.js
chmod +x ./tests/9-main.js
npm run dev ./tests/9-main.js
touch 10-loops.js
chmod +x 10-loops.js
npm run lint 10-loops.js --fix

touch ./tests/10-main.js
chmod +x ./tests/10-main.js
npm run dev ./tests/10-main.js
touch 11-createEmployeesObject.js
chmod +x 11-createEmployeesObject.js
npm run lint 11-createEmployeesObject.js --fix

touch ./tests/11-main.js
chmod +x ./tests/11-main.js
npm run dev ./tests/11-main.js
touch 12-createReportObject.js
chmod +x 12-createReportObject.js
npm run lint 12-createReportObject.js --fix

touch ./tests/12-main.js
chmod +x ./tests/12-main.js
npm run dev ./tests/12-main.js
touch 100-createIteratorObject.js
chmod +x 100-createIteratorObject.js
npm run lint 100-createIteratorObject.js --fix

touch ./tests/100-main.js
chmod +x ./tests/100-main.js
npm run dev ./tests/100-main.js
touch 101-iterateThroughObject.js
chmod +x 101-iterateThroughObject.js
npm run lint 101-iterateThroughObject.js --fix

touch ./tests/101-main.js
chmod +x ./tests/101-main.js
npm run dev ./tests/101-main.js

📚 References

  1. Using Babel
  2. Getting Started with ESLint
  3. npm vs npx — What’s the Difference?
  4. Jestr Getting Started

👨 Author and Credits.

This project was done by SE. Moses Mwangi. Feel free to get intouch with me;

📱 WhatsApp +254115227963

📧 Email [email protected]

👍 A lot of thanks to ALX-Africa Software Engineering program for the project requirements.