I'm trying to sort a big collection of data in google sheets app script which doesn't support ES6! (I think)
The array looks something like this var data = [["Frank", "[email protected]", 21],["Mark", "[email protected]", 23]]
I would love the idea to turn the array into objects where I can access every object by the name ex:
Frank.name
Frank.email
Frank.age
I tried the following
function Driver(name, email, age) {
this.name= name;
this.email= email;
this.age = age;
}
and then
for(var i=0; i<data.length; i++){
data[i][0]= new Driver (data[i][0],data[i][1],data[i][2])
}
But it is not working Can You help me with this?