I used this vue.js library that requires an array in this format
autocompleteItems: [
{
text: "Css"
},
{
text: "Javascript"
},
{
text: "Java"
},
{
text: "Web Design"
},
{
text: "Spring"
}
],
However I need to get the items of that array from other array, how do I turn my "normal" array to this required format?
text
property.newArray = oldArray.map(text => {text})
array=['Css','Javascript','Java']
and I need to turn that into an array of obejcts with atext
property['one', 2, { value: 'three'}]
is a valid array. MDN: Array