Could you please help me to prepare below Object from string using JS. I am new in JS.
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open new_log jdbc1233q6AiRUSRCczayjz0rw 1 1 603442 0 127.6mb 127.6mb
From above string how do I create below object?
{
"health": "yellow",
"status": "open",
"index": "new_log",
"uuid": "jdbc1233q6AiRUSRCczayjz0rw",
"pri": "1",
"rep": "1",
"docs.count": "603442",
"docs.deleted": "0",
"store.size": "127.6mb",
"pri.store.size": "127.6mb"
}
String.prototype.split,Array.prototype.map,JSON.stringify. Where are your attempts? Edit the post.