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?
textproperty.newArray = oldArray.map(text => {text})array=['Css','Javascript','Java']and I need to turn that into an array of obejcts with atextproperty['one', 2, { value: 'three'}]is a valid array. MDN: Array