institut-de-genomique / Ultimate-DataTable

This AngularJS directive generate a HTML table with build-in fonctionnality like save, edit, remove, pagination etc...
http://institut-de-genomique.github.io/Ultimate-DataTable/
45 stars 26 forks source link

What is the reason for using property name "clazz"? #19

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hey. I'm wondering why are you using word clazz as property name instead of class? In ex. in pagination computing. My only guess is that class is reserved word but it's OK to use it as a property name in ES5.

Jenselme commented 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).

galbini commented 8 years ago

Hi,

Jenselme is right, we have started the development under firefox and some words are reserved and we want not used quotes with property.

ghost commented 8 years ago

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.

Jenselme commented 8 years ago

@kdkwiatkow that works indeed.