es6-26

PHOTO EMBED

Wed Oct 12 2022 02:23:01 GMT+0000 (Coordinated Universal Time)

Saved by @Vrushabh_123

let name = 'Tanay'
let line = 'Helloo ' + name + ' !'
console.log(line)

const helloTemp = `Hello ${name} !`
console.log(helloTemp)

const giveMeFive = () => 5
const line2 = `Hey, my roll is ${giveMeFive()}`
console.log(line2)

// Question: variable 5 // "odd" ->> write this function, using arrow
// Question: use this function in a sentence using template literal

// Shivam's answer
const oddOrEven = (num) => (num % 2 === 0 ? 'even' : 'odd')
const res = `The number 5 is ${oddOrEven(5)} ${name}`
content_copyCOPY