Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
riffraff
on March 2, 2014
|
parent
|
context
|
favorite
| on:
JSON5 is a proposed extension to JSON
can't you just do
_dontcare = {es5: syntax, /*with comments*/} data = JSON.stringify(_dontcare) ?
captainmuon
on March 2, 2014
|
next
[–]
Yeah, you can do that in your .js source, but not in a separate, non-executed file. It is useful IMHO to separate static data from code. Also, this is useful for configuration files.
veidelis
on March 2, 2014
|
prev
[–]
No, because syntax is undefined. Trailing comma and comment is removed when it is stringified.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: