Closed ghost closed 8 years ago
My only guess is that class is reserved word but it's OK to use it as a property name in ES5.
I'm affraid it's not OK for long. In firefox 43, if I type {class: 789}
in the console, I get SyntaxError: class is a reserved identifier
, so I don't expect that it would work. Furthermore, with ES6 coming, I guess udt developers shouldn't use class
(at least without quotes).
Hi,
Jenselme is right, we have started the development under firefox and some words are reserved and we want not used quotes with property.
One way or another it's probably better to not use it. I was just curious what was your idea.
if I type {class: 789} in the console, I get SyntaxError: class is a reserved identifier + development under firefox and some words are reserved
Yes, but try var x = {class: 789}; x;
. It waill also pass in real compilation and runtime.
@kdkwiatkow that works indeed.
Hey. I'm wondering why are you using word
clazz
as property name instead ofclass
? In ex. in pagination computing. My only guess is thatclass
is reserved word but it's OK to use it as a property name in ES5.