Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

change array of object to object without index value

const array = [ 'one', 'two', 'three' ]
var res={}
array.forEach(function(a){
  res[a]=a
})
console.log(res)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #change #array #object #object #index
ADD COMMENT
Topic
Name
2+7 =