Skip to content

Latest commit

 

History

History
63 lines (43 loc) · 1012 Bytes

introduction.md

File metadata and controls

63 lines (43 loc) · 1012 Bytes

Javascript basics

  • Let : Variable values
  • const: Constant values

Arrow function

const myFunction = (param) => {
    ...
}

Is equivalent to

function myFunction(param){
    ...
}

Arrow function will not change the context at runtime so no need of 'this' keyword into arrow function

Exports and Imports

person.js

const person = {
    return 'max';
}

export default person;

utility.js

export const clean = () =>{
    ...
}

export const baseData = 10;
  1. Import the default exported. We can give any name like person or man.
import person from './person.js';
  1. It is called named import. we need to give exact name as given at the time of export. We can import more then one exported value into one statement by sperate it in comma.
import {clean} from './utility.js';
  1. Here we import all the exorted values.
import * as util from './utility.js';