Conversation
|
I'm in support of this 👍 |
|
Of course, the exception is when some other service (like Wish Lists) expects an object with keys like |
|
That also makes sense 👍 |
|
@spikebrehm If your service is talking in JSON, it should respect the no-JS-keyword usage rule as well. It is JavaScript Object Notation after all. |
|
@ssorallen unfortunately that's not generally true. Plus, JSON keys have to be quoted in the first place to be valid. |
|
I like the idea that we should stay away from using reserved words if possible. Maybe the guideline should be that if you're creating an object in JS that will be consumed by other JS, it shouldn't use reserved words? And if it's being created elsewhere and you can't control it, or you need to send it somewhere that unfortunately expects reserved words, then quote it like @spikebrehm and originally @h4rry propose. |
|
@spikebrehm Aha, good point about quoting keys in JSON. You have to quote uses of keywords as keys though, it's not an option or a style preference; it's a syntax error. The style guide should still say, "Don't use keywords as keys." |
Scrollable container horizontal & vertical + some input refactoring
Add two translated sections
This one has bitten us in the past.
defaultis a reserved word in JavaScript and causes exceptions when used. We shouldn't have an exception to this rule: just don't do it!