Message from JavaScript discussions

July 2018

— Text please

— 

[
["custom"],
["presets", ["minimial", "standard", "react"]],
[
"test",
[
["minimial", ["minimimal1", "minimial2"]],
["standard", ["subMenu", "subMenu2", "subMenu3", "subMenu4"]],
"react"
]
]
]

— Source:

[
["custom"],
["presets", ["minimial", "standard", "react"]],
[
"test",
[
["minimial", ["minimimal1", "minimial2"]],
["standard", ["subMenu", "subMenu2", "subMenu3", "subMenu4"]],
"react"
]
]
].map(x => x)


Result:
[ [ 'custom' ],
[ 'presets', [ 'minimial', 'standard', 'react' ] ],
[ 'test', [ [Object], [Object], 'react' ] ] ]

Message permanent page

— Already works

— Its a json

— Source:

JSON.parse('[
["custom"],
["presets", ["minimial", "standard", "react"]],
[
"test",
[
["minimial", ["minimimal1", "minimial2"]],
["standard", ["subMenu", "subMenu2", "subMenu3", "subMenu4"]],
"react"
]
]
]')


Exception:
SyntaxError: Invalid or unexpected token

Message permanent page

— Oh i do not even need to parse

— Or stringify

— Sorry mb haha

— Yep....

— Ahh, this just failed because multiline strings aren't a thing

— Used to have it wrapped in objects when working with json