What is the output of `’5′ + 3` in JavaScript?

JavaScript Associate Easy

JavaScript Associate — Easy

What is the output of `’5′ + 3` in JavaScript?

Key points

  • JavaScript performs type coercion when adding a string and a number
  • The result is a string because JavaScript converts the number to a string for concatenation
  • The single quotes around the numbers indicate they are strings

Ready to go further?

Related questions