What is the output of: Boolean([]) in JavaScript?

JavaScript Associate Easy

JavaScript Associate — Easy

What is the output of: Boolean([]) in JavaScript?

Key points

  • JavaScript considers an empty array as a truthy value
  • The Boolean() function converts the empty array to a Boolean value
  • In JavaScript, an empty array evaluates to true in a Boolean context

Ready to go further?

Related questions