What is the output of: console.log([] + [])?

JavaScript Developer Medium

JavaScript Developer — Medium

What is the output of: console.log([] + [])?

Key points

  • The + operator converts arrays to strings for concatenation.
  • An empty array is represented as an empty string.
  • The result of [] + [] is not 0 or [], but an empty string ('').

Ready to go further?

Related questions