|
|
|
|
|
by krapp
1722 days ago
|
|
I know this is how Javascript is done nowadays but using constructors for maps and arrays just seems like unnecessary syntax to me. And if you're going to initialize an array buffer too, you might as well just not use JSON at all and send plain Javascript code over the wire. I think all JSON needs in this regard is type hinting. Let everything else be handled by the application: {
birthdayParty: Date 1632817436514,
sounds: String? { // zomgwtfbbq comments too
cow:"moo",
fox: null
},
possibilities: ["she loves me", "she loves me not", 42],
aSymbol: Symbol "tag",
aBuffer: Uint8 [104, 101, 108, 108, 111]
}
|
|
Obviously, in your version my approach would be
I suppose that the idea could be that type hints are entirely ignoreable, and if you strip them the file just becomes normal JSON?