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>
β
Correct Answer: (C)
It will concatenate both the stings and print as 1, 2, 3, 4, 5, 6, 7, 8, 9 ,10