Index

Reactjs

  1. Arrow Function
  2. Spread
  3. Destructuring
  4. Understanding the Base Features Syntax
  5. Working with Lists and Conditionals
  6. Styling React Components Elements

Arrow Function

Arrow Function:
const printMyName = (name) => {
console.log(name);
}
printMyName('Max');


For single argument, it can also be written as:
const printMyName = name => {

    console.log(name)

}
printMyName('Max');



For no argument:
const printMyName = () => {
    console.log("Max);

}



Exports and Imports (Modules)
images/395-1.png

images/395-2.png


images/395-3.png


class Person {
    constructor () {
        this.name = 'Max';
    }
    printMyName(){
        console.log(this.name);
    }
}

const person = new Person();

person.printMyName();




class Human {
    constructor() {
        this.gender = 'male';
    }
    printGender(){
        console.log(this.gender);
    }
}





class Person {
    constructor () {
        super();
        this.name = 'Max';
        this.gender = 'female';
    }
    printMyName(){
        console.log(this.name);
    }
}

const person = new Person();

person.printMyName();
person.printGender();



images/395-4.png