On Wed, Jun 8, 2011 at 3:13 PM, Bob Nystrom <[email protected]> wrote:
>
> That's better, but "public" and "private" are still less than ideal
> keywords here since Javascript's use of them is distinctly different from
> other languages. Alas, they were the best we could come up with.
>

"public" confuses me because its name is related to access control. And
because the following doesn't make any sense and I expected to be able to
declare a private instance property:

*class *Monster {
    *private public* health = 10;
}

So, taking a page from CoffeeScript's for own ... in extension, what do you
think about this?

*class *Monster {

    *private own* health = 10;

    *private static *allMonsters = [];

    *own *id;

    constructor() {
        *this*.id = Monster.allMonsters.length;
        Monster.allMonsters[this.id] = this;
    }

}

Juan
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to