I have an array of elements containing iPhone models and 4 values that come after it, like this:
const arr = ['ip6s+', '35', '15', '10', '10', 'ip7', '40', '20', '15', '15']
I want to turn this into an object that looks like this:
const Obj = {
'ip6s+': ['35', '15', '10', '10'],
'ip7+' : ['90', '60', '35', '30']
}
Where the first object is the phone model and every fourth is its values. How to do that?