M Mỹ An New member Sep 19, 2021 #1 What will be the output of the following JavaScript code? Code: <p id="demo"></p> <script> var x = 10; var y = 20; document.getElementById("demo").innerHTML = x + y; </script> A. 1020 B. 10 20 C. 30 D. Error
What will be the output of the following JavaScript code? Code: <p id="demo"></p> <script> var x = 10; var y = 20; document.getElementById("demo").innerHTML = x + y; </script> A. 1020 B. 10 20 C. 30 D. Error
N Nguyễn Thành Huy New member Sep 19, 2021 #2 Answer: a Explanation: The two numbers will not get and rather get concatenated as string. Therefore the output will be 1020. Upvote 0 Downvote
Answer: a Explanation: The two numbers will not get and rather get concatenated as string. Therefore the output will be 1020.