Why do you report an error when you use performance.now () like this?

The

code is not complicated, but I can"t figure out why

var t = performance.now()

(function a() {
  console.log(1)
  setTimeout(a,100)
})()

if the first line var t =. is removed, the code execution is correct. Keep the first line now, and the code will report
TypeError: performance.now (.). Is not a function is there any conflict between
performance.now () and setTimeout ? Thank you in advance ~

Mar.16,2022

when using IIFE , the previous code snippet must have a semicolon at the end. This is the insurance practice

var t = performance.now()

;(function a() {
  console.log(1)
  setTimeout(a,100)
})()
Menu