The fact that the “insulting anal thing with quotes around attribute names,” as you call it, is the result of Douglas Crockford’s decision to greatly simplify the JSON format and make JSON parser entries much easier .
, JavaScript : break, case, catch, class, const, continue, debugger, default, delete, do, else, enum, export, extends, false, , , , if, , , in, instanceof, , let, new, null, package, private, protected, public, return, static, super, switch, this, throw, true, try, typeof, var, void, while, with yield, .
, JavaScript.
" " JavaScript- , , JavaScript-.
UPDATE:
, - , JSON- , JSON ( ), , JSON .
, , SDXF (RFC 3072 - ) BSON ( JSON, - JSON- ) , JSON (, 1% gzipped- ).
2:
, JSON, :
[{"a":1,"b":2,"c":3,"d":4},null,null,{"a":9,"b":10,"c":11,"d":12}]
66 . JavaScript, :
[{a:1,b:2,c:3,d:4},,,{a:9,b:10,c:11,d:12}]
42 . ( , - , [1,,2,,] 4 - Firefox , , 5- IE.)
, . , :
a1b2c3d4,,,a9b10c11d12
22 . , . , . , CFON Compact Flat Object Notation.
JSON, :
var inp = input.split(','),
out = [], i, j, m, p, output;
for (i = 0; i < inp.length; i++) {
if (inp[i]) {
out[i] = {};
m = inp[i].match(/[a-z]+\d+/ig);
for (j = 0; j < m.length; j++) {
p = /([a-z]+)(\d+)/i.exec(m[j]);
out[i][p[1]] = p[2];
}
}
}
output = JSON.stringify(out);
. CFON → JSON DEMO.
JSON , :
var inp = JSON.parse(input),
out = [], i, k, output;
for (i = 0; i < inp.length; i++) {
out[i] = '';
if (inp[i]) {
for (k in inp[i]) {
if (inp[i].hasOwnProperty(k)) {
out[i] += k + inp[i][k];
}
}
}
}
output = out.join(',');
. JSON → CFON DEMO.
, , CFON. - , .
, . , , . , , . , - , .