Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Historically, you couldn't use ANY of them as object literal keys without risking problems. I believe it was an oversight.

JS has reserved a really long list of keywords that have been around for a long time.. I've seen this occasionally trip up new JS programmers because the words are special without having any use.

abstract, arguments, await, boolean, break, byte, case, catch, char, class, const, continue, debugger, default, delete, do, double, else, enum, eval, export, extends, false, final, finally, float, for, function, goto, if , implements, import, in, instanceof, int, interface, let, long, native, new, null, package, private, protected, public, return, short, static, super, switch, synchronized, this, throw, throws, transient, true, try, typeof, var, void, volatile, while, with, yield



Well, right, but this is JSX, not JS. The rest of JSX is also illegal in JS.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: