Primitives vs. Objects, Ruby-like features

Waldemar Horwat waldemar at google.com
Wed Mar 26 11:04:21 PDT 2008


Darryl wrote:
> And sometimes theres weird syntax errors:
> 
> 5.prototype //parse error

Just put a space before the dot if you want to get a property of the wrapper of the number 5:

5 .property

There are other, about equally useful scenarios where you need to insert spaces to lex tokens the way you want:

x//regexp/
should be expressed as:
x/ /regexp/
so it doesn't look like a comment.

    Waldemar



More information about the Es4-discuss mailing list