Arrow Function

 



// Regular Function

const addRegular2 = function(a, b) {

  return a + b;

};


// Arrow Function (concise)

const addRegular1 = (a, b) => a + b; // Implicit return


console.log(addArrow1(2, 3)); // 5



Comments

Popular posts from this blog

Experiment 1: Node.js

Experiment 10: ReactJS – Render HTML, JSX, Components – function & Class

Experiment 6: ExpressJS – Routing, HTTP Methods, Middleware