Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

convert array to object with custom keys

const yourArray = ['Jimbo', '555-555-5555', 'jimbo@aol.com'];

const [name, phone, email] = yourArray;
const yourObject = { name, phone, email };

console.log(yourObject);
 Run code snippet
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #array #object #custom #keys
ADD COMMENT
Topic
Name
9+4 =