Skip to content

It's a javaScript core project. Here has been any kind of topic and concept. Easy to used and thinking of javaScript tutorial for the web developers & engineers.

Notifications You must be signed in to change notification settings

simons-devtools/javascript-concepts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaScript-Core-Concepts

This is my private repository. Becouse it has been 'JavaScript & React core concept'...

Most important syntex in JavaScript:

  1. Variable declearation----- (let, const);
  2. Condition----- (if, else);
  3. Array and Object----- (number, string);
  4. Loop----- (for-loop, while-loop);
  5. Function-----(normal, arrow);

Most important (Array, Object) Core methods:

  1. Map-----(array into object OR [{...}, {...}, {...}] ) OR Get property and return;
  2. Foreach-----(array into object OR [{...}, {...}, {...}] ) OR Get property and console.log;
  3. Filter-----(choose item, removed item);
  4. Find-----(find out the special array OR object properties);

@ Extra JS Array Methods:

  1. reduce()
  2. includes()
  3. push()
  4. pop()
  5. length()
  6. indexOf()

@ NOTE:

  1. Array and Object Destructuring and (Array in Three Dots);
  2. JS Shortcut Ternary-----(Variable Name = Condition ? True value : False value);
  3. API AND JSON-----(Api-Featch, Convert-Structure = Json to Object and Object to Json = [[ console.log(JSON.stringify(objectName)) && myData = JSON.stringify(objectName)) ]];

Fetch JSON Localstorage object keys values: (Set && get)

  1. Featch '03' WEB-API and create DOM website;
  2. Set Object/JSON Local-Storage (keys && values) = { VariableName = Object.keys(objectName) };
  3. Get Object/JSON Local-Storage (keys && values) = { VariableName = Object.values(objectName) };
  4. Array in Object Name = [{id: 01, name: 'theMealdb = https://www.themealdb.com/api.php', categories: 'Food Images'}, // {id: 02, name: 'pixabay = https://pixabay.com/api/docs/', categories: 'Images && Videos'}, // {id: 03, name = 'theMealdb: https://www.themealdb.com/api.php', categories: 'Name'}];

Node.js/new apps setup table

Update Node

Please follow the below instructions to update node in your machine:

Windows

  1. Update npm
    npm install npm@latest -g
  2. Clear npm cache
    npm cache clean -f
  3. Install n
    npm install -g n
  4. Update node to latest version
    n latest

Mac

  1. With Homebrew
    brew update
    brew upgrade node

Install and Update yarn

Please follow the below instructions to install or update yarn in your machine.

On Windows

  1. Install yarn
    npm install -g yarn
  2. Update yarn
    yarn set version latest

On Mac

  1. Install yarn
    brew install yarn
  2. Update yarn
    brew update
    brew upgrade yarn

VS Code Editor Setup

In order to follow along the tutorial series, I recommend you to use Visual Studio Code Editor and install & apply the below extensions and settings.

Extensions

Install the below extensions:

Settings

Go to your Visual Stuido Code settings.json file and add the below settings there:

// config related to code formatting
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"[javascript]": {
  "editor.formatOnSave": false,
  "editor.defaultFormatter": null
},
"editor.codeActionsOnSave": {
  "source.fixAll.eslint": true,
  "source.organizeImports": true
},
"eslint.alwaysShowStatus": true

Set Line Breaks

Make sure in your VS Code Editor, "LF" is selected as line feed instead of CRLF (Carriage return and line feed). To do that, just click LF/CRLF in bottom right corner of editor, click it and change it to "LF". If you dont do that, you will get errors in my setup.

Line Feed

Linting Setup

In order to lint and format your code automatically according to popular airbnb style guide, I recommend you to follow the instructions as described in video. References are as below.

Install Dev Dependencies

yarn add -D eslint prettier
npx install-peerdeps --dev eslint-config-airbnb-base
yarn add -D eslint-config-prettier eslint-plugin-prettier

Setup Linting Configuration file

Create a .eslintrc.json file in the project root and enter the below contents:

{
  "extends": ["prettier", "airbnb-base"],
  "parserOptions": {
    "ecmaVersion": 12
  },
  "env": {
    "commonjs": true,
    "node": true
  },
  "rules": {
    "no-console": 0,
    "indent": 0,
    "linebreak-style": 0,
    "prettier/prettier": [
      "error",
      {
        "trailingComma": "es5",
        "singleQuote": true,
        "printWidth": 100,
        "tabWidth": 4,
        "semi": true
      }
    ]
  },
  "plugins": ["prettier"]
}

About

It's a javaScript core project. Here has been any kind of topic and concept. Easy to used and thinking of javaScript tutorial for the web developers & engineers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published