4 ways to writing javascript function

default function declaration

 function sum(a,b){return a+b;}

function expression


const sum =  function sum(a,b){return a+b;}

arrrow function

const sum = (a,b) => {return a+b;}

consiec arrow function

const sum = (a,b) =>a+b;




No comments:

Post a Comment

Event listening in react

 How we can listen to som eevents some envents fire like click or automatically user enters into input button , that is event on word type i...