H Huyền Thu 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"; var z = x + y; document.getElementById("demo").innerHTML = z; </script> A. 30 B. 10 20 C. 1020 D. Error
What will be the output of the following JavaScript code? Code: <p id="demo"></p> <script> var x = 10; var y = "20"; var z = x + y; document.getElementById("demo").innerHTML = z; </script> A. 30 B. 10 20 C. 1020 D. Error
Đ Đặng Thị Thúy Hằng New member Sep 19, 2021 #2 Answer: c Explanation: If a number and a numeric string is added, then the result will be a concatenated string. The two numbers will not be added as they are of different types. Upvote 0 Downvote
Answer: c Explanation: If a number and a numeric string is added, then the result will be a concatenated string. The two numbers will not be added as they are of different types.