Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why not just:

[ "div", "The ", [ "a", { "href": "https://www.json.org/" }, "JSON format" ], " was invented by ", [ "em", "Douglas Crockford" ], "." ]

First thing in array is element, if there is an object at the second location then that's the attributes?



Yeah that seems to make the most sense. I had to actually work it out before I saw it. I was looking for some further separation beyond indices but I just ended up over-thinking it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: