Json improvments with json5

Oscar Brito

JSON5 by aseemk

These are the new features of JSON5's syntax. All of these are optional, and all of these are part of ES5 JavaScript.

Object keys don't need to be quoted if they're valid identifiers. Yes, even reserved keywords are valid unquoted keys in ES5 [§11.1.5, §7.6].

[TODO: Unicode characters and escape sequences aren't yet supported in this implementation.]

Strings can be single-quoted.

Strings can be split across multiple lines; just prefix each newline with a backslash. [ES5 §7.8.4]

Objects and arrays can have trailing commas.

Both inline (single-line) and block (multi-line) comments are allowed.

Numbers can be hexadecimal (base 16), and they can also begin with a leading decimal (e.g..5).



Visit www.divhide.com for more informations, contacts and news about Web Development.
See other blog posts at blog.divhide.com.

Divhide purpose is to follow the HTML5 movement and contribute with applications which prove the quality of technology.
Feel free to contact divhide.