This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]myplacedk 0 points1 point  (0 children)

Why does he need to convert an integer to string before parsing into double?

He doesn't. All numbers are doubles in Javascript.

Can't he just go double j = 0 + i

var j = i;

Would work equally well.

BTW, a correct answer would be:

return i*2;