0


let func=(a,b)=>{
  console.log(a+b)
}

let funci2=func=>(a,b)=>{
  console.log('2nd console')
  func(a+b)
}

let a =3
let b=5

funci2(func(a,b))

Came up with problem while programming. I know it's going to be something very childish. In JS, why 2nd console is not printing? Output is just 8.

Raayat Ahmed
  • 33
  • 1
  • 5

1 Answers1

0

funci2 takes one parameter and returns an arrow function. You do not call that function, so the console.log statement inside is not executed.

Unmitigated
  • 76,500
  • 11
  • 62
  • 80