i have a array of array lets call it x
let x = [
["Last Name", "First Name", "Email Address", "Role", "Employee id (optional)"],
["Smith", "John", "[email protected]", "Employee", "ABC123XYZ"],
["Doe", "Jane", "[email protected]", "Verifier", "ABC123XYZ"]
]
how do i make it to
[
{
"Last Name": "Smith",
"First Name": "John",
"Email Address": "[email protected]",
"role": "Employee",
"Employee id": "ABC123XYZ"
},
{
"Last Name": "Doe",
"First Name": "Jane",
"Email Address": "[email protected]",
"role": "Verifier",
"Employee id": "ABC123XYZ"
}
]
how to construct a function which can return the above format