What is the output of: console.log(1 + ‘2’ + 3)?

JavaScript Developer Medium

JavaScript Developer — Medium

What is the output of: console.log(1 + ‘2’ + 3)?

Key points

  • JavaScript performs implicit type coercion when combining numbers and strings
  • The + operator concatenates strings when one of the operands is a string
  • The order of operations in JavaScript is left-to-right

Ready to go further?

Related questions