What does "1"+2+4 evaluate to?

Answers were Sorted based on User's Feedback



What does "1"+2+4 evaluate to?..

Answer / hk

Anything which follows string is converted to String.
Hence, "1" is string, and the digits 2 and 4 which comes
after this, also become part of string only.

So the answer is 124

Is This Answer Correct ?    70 Yes 2 No

What does "1"+2+4 evaluate to?..

Answer / kmbkrishnan

124

Is This Answer Correct ?    32 Yes 5 No

What does "1"+2+4 evaluate to?..

Answer / hk & kmbkrishnan

Write a program in java and execute it with the following
code bellow:

System.out.println("1"+2+4);

And see the output.

Thanks & Regards
Hk and Kmbkrishnan

Is This Answer Correct ?    28 Yes 4 No

What does "1"+2+4 evaluate to?..

Answer / madhu

answer is 124.

Is This Answer Correct ?    17 Yes 2 No

What does "1"+2+4 evaluate to?..

Answer / akash

it is 124 as it is ins tring format and after that what ever
b there is considered as string

Is This Answer Correct ?    8 Yes 0 No

What does "1"+2+4 evaluate to?..

Answer / shikha

answer is 124 as "1" in the starting is consider as a
string, therefore all other nos after that is consider as a
string unless brackets are not used.

Is This Answer Correct ?    7 Yes 0 No

What does "1"+2+4 evaluate to?..

Answer / jay

document.write("1"+ 2 + 4);

Is This Answer Correct ?    1 Yes 0 No

What does "1"+2+4 evaluate to?..

Answer / g.sai suresh

124

Is This Answer Correct ?    0 Yes 0 No

What does "1"+2+4 evaluate to?..

Answer / ashraf

I think ans is 16

Is This Answer Correct ?    4 Yes 17 No

What does "1"+2+4 evaluate to?..

Answer / ashwin

i think ans is 1+6

Is This Answer Correct ?    0 Yes 33 No

Post New Answer

More JavaScript Interview Questions

List out all the falsifying tokens in Javascript?

0 Answers  


What are all the types of Pop up boxes available in JavaScript?

0 Answers  


How onclick works in javascript?

0 Answers  


In how many ways a Javascript code can be involved in an HTML file?

1 Answers  


Can any one tell me how Java is purely an Oops language

3 Answers  






What are the benefits of learning javascript?

0 Answers  


How to reload a page using JavaScript?

0 Answers  


Do I need var in javascript?

0 Answers  


What do “1”+2+4 evaluate to?

0 Answers  


Are namespaces are there in javascript?

0 Answers  


What is missing in my code? function numberTally(numList) { var evenTotal = 0; var oddTotal = 0; for (var i = 0; i <= numList.length; i++) { if i % 2 { // i is odd oddTotal += numList[i]; // or oddTotal = oddTotal + numList[i]; } else { // i is even evenTotal + numList[i]; } } alert(oddTotal); return evenTotal; }

0 Answers  


How to replace all occurrences of a string in JavaScript?

0 Answers  


Categories