I have an object defined below.
var obj = { 'group': ['a', 'b'],
'value': 10
}
Please note that group array can have n values. This is just an example. I want to create dynamic variables with names in array and assign their sum equal to value i.e 10. So for this particular object I want the following result.
First create Variables
var a, b
Then assign a + b = 10
Similarly for n values in array, I want
var a,b, ...n
a+b+....+n = 10
a=10andb=0what you want? It satisfiesa+b=10.