What is the result of below given line of code in java script? 5+4+'7'?



What is the result of below given line of code in java script? 5+4+'7'?..

Answer / Amit Kumar Ahirwar

"The result will be 16 (because JavaScript concatenates strings and numbers, so '7' is considered as a string here. To fix this, you need to wrap the number 7 in quotes: 5+4+'7' => 5+4+'7' => 11"

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JavaScript Interview Questions

java is pure object oriented or not?

4 Answers  


How to convert “20” to number in javascript?

1 Answers  


What’s a way to append a value to an array?

1 Answers  


Explain the for-in loop?

1 Answers  


What are the javascript data types?

1 Answers  


What is null javascript?

1 Answers  


wap to accept an int array frm the user and print the lucky nos.

1 Answers  


How to delete a cookie using javascript?

1 Answers  


Can you use javascript to hack?

1 Answers  


How onclick works in javascript?

1 Answers  


What is the data type of variables of in javascript?

1 Answers  


How to import all exports of a file as an object.

1 Answers  


Categories