Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
elisee
on July 3, 2015
|
parent
|
context
|
favorite
| on:
Airbnb JavaScript Style Guide
Interesting. Is that common in your workflow to embed JSON as string literals in JavaScript? Never had to do that. I'd probably use ES6 backticks, so as to have multiline support and skip the need to escape both single and double quotes.
adrusi
on July 3, 2015
[–]
Right, why write
'{ "foo": "bar" }'
when you could write
JSON.stringify({ foo: "bar" })
and get a static guarantee of valid JSON?
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: