I am learning to use underscore js. I grouped the array. But now i need split array.
I have a grouped JSON array. For example;
var arr = [{"key": "A", "value": ["erdem", "metin", "tamer", "hüseyin"]}]
I want this to be the result.
var arr = [{"key" : "A", "value" : "erdem"},{"key" : "A", "value" : "metin"},{"key" : "A", "value" : "tamer"},{"key" : "A", "value" : "hüseyin"}]
I'm happy if you show me how to do it.
_.flatten(_.map(yourArr, theSplitFunction), true);