-
What will be the output of the following Javascript code?
var str1 = ”4321”;
var intval = 4321;
alert( str1 + intval );
-
- 4321
- 43214321
- 8642
- 12341234
- None of these
Correct Option: B
In JavaScript the alert function does the type casting and converts the integer value to string. After that it concatenates both the strings and shows the result as a concatenated string. Thus 43214321 would be correct.