I am not able to return the value of this variable someobj
. Any thoughts much appreciated.
getSomeObj: function () {
let arr1 = ["abc", "def", "efh", "xys", "xus"];
someobj = {};
arr1.map((type) =>{
// Gets the value from a promise as an array
this.getValuesOfSomeObj(type).then(function(vals){
(vals.map((val) =>{
someobj[val.name] = val.name;
someobj[val.title] = val.title; //I am getting value here
}));
});
});
return someobj; //I am not getting it here
}