Comment #4 on issue 291 by [email protected]: array indexes are always  
of type string
http://code.google.com/p/v8/issues/detail?id=291

Note that multiplying the key by one isn't necessarily the cleanest way of  
converting
a string to a number. I'd go for using the unary + operator like:

    print(+k + 2);

or maybe even use Number(k) to make it less magical:

    print(Number(k) + 2)

See ECMA-262, 3rd edition, section 11.4.6 ("Unary + Operator") on page 47  
and section
15.7.1.1 ("Number([value])") on page 107.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to