Arrow Function

PHOTO EMBED

Fri Sep 16 2022 13:41:06 GMT+0000 (Coordinated Universal Time)

Saved by @sreejithbs

const square = n => {
  return n * n
}

console.log(square(2))  // -> 4

// if we have only one line in the code block, it can be written as follows, explicit return
const square = n => n * n  // -> 4
content_copyCOPY

https://github.com/Asabeneh/30-Days-Of-JavaScript/blob/master/07_Day_Functions/07_day_functions.md