I have an array with prefix values
["options_a",
"options_b",
"options_c",
"capable_d",
"capable_e_c"
]
i need the output to be in object format with prefix as key and grouped split string as value
object output format needed
{
"options":["a","b","c"],
"capable":["d","e_c"]
}
it can be done with normal for loop, but is there better way of achieving it with simplified form using es6 functionality.
Thank you.