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

JavaScript Developer Medium

JavaScript Developer — Medium

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

Key points

  • Concatenating an array and an object results in string conversion
  • An empty array becomes an empty string
  • An empty object becomes '[object Object]'
  • The output is the string '[object Object]'

Ready to go further?

Related questions