es6-11

PHOTO EMBED

Wed Oct 12 2022 01:57:28 GMT+0000 (Coordinated Universal Time)

Saved by @Vrushabh_123

// with no parameter
const getNum = () => 2

// ES5 function
function getNum() {
  return 2
}

// with one parameter
// Function
const isOne = (num) => num == 1 // HW: === vs == in JavaScript, write a blog.

// Calling the function
console.log(isOne(12))

// Vinay

function isOne(num) {
  return num === 1 ? true : false
}

// Hiren
function isOne(num) {
  console.log(num)
}
content_copyCOPY