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

You don't have to quote the LHS of the => operator, even if "use strict" is on. (That's the only way that it differs from a regular comma.)

> The "=>" operator (sometimes pronounced "fat comma") is a synonym for the comma except that it causes a word on its left to be interpreted as a string if it begins with a letter or underscore and is composed only of letters, digits and underscores. This includes operands that might otherwise be interpreted as operators, constants, single number v-strings or function calls. If in doubt about this behavior, the left operand can be quoted explicitly.

> Otherwise, the "=>" operator behaves exactly as the comma operator or list argument separator, according to context.



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

Search: