It converts Object to boolean. If it was falsey (e.g. 0, null, undefined, etc.), it will be false, otherwise, true.

References:

  • https://dev.to/macmacky/70-javascript-interview-questions-5gfi#16-what-does-the-operator-do
  • https://stackoverflow.com/questions/784929/what-is-the-not-not-operator-in-javascript