0

I looked at someone's code and found this line,

;[result] = await session.onWhatsApp(jid)

what is the meaning of using a semicolon before a square bracket?

what is the different between this:

[result] = await session.onWhatsApp(jid)

and this:

;[result] = await session.onWhatsApp(jid)

enter image description here

Zulfikar Ahmad
  • 407
  • 1
  • 7
  • 18
  • 2
    It's there to prevent problems that might carry over from the previous line of code thanks to JavaScript automatic semicolon insertion rules. – Pointy Oct 19 '22 at 01:57
  • 2
    https://stackoverflow.com/questions/1873983/what-does-the-leading-semicolon-in-javascript-libraries-do – taylorswiftfan Oct 19 '22 at 01:58

0 Answers0