A

Admin • 833K Points
Coach

Q. What will be the output of the following JavaScript code?

Code:
<script>
var string1=[1,2,3];

var string2=[4,5,6,7,8,9,10];
var result=string1.concat(string2);
document.writeln(result);
</script>
  • (A) 1, 2, 3
  • (B) Error
  • (C) It will concatenate both the stings and print as 1, 2, 3, 4, 5, 6, 7, 8, 9 ,10
  • (D) It will print nothing
  • Correct Answer - Option(C)
  • Views: 25
  • Filed under category JavaScript
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.