Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

change key in array of objects javascript

let arrayObj = [{key1:'value1', key2:'value2'},{key1:'value1', key2:'value2'}];

arrayObj = arrayObj.map(item => {
      return {
        stroke: item.key1,
        key2: item.key2
      };
    });
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #change #key #array #objects #javascript
ADD COMMENT
Topic
Name
4+4 =