I am trying console log the variable arrItems outside of .then(). any suggestion? Thanks in advance.
protected fun(){
sp.web.lists.getByTitle("Requests")
.items.get()
.then((items: any[]) => {
var arrItems = items.map((order) => {
var info = {
"Id": order.Id, "File": order.FileName
}
return info;
})
console.log(arrItems) // works
},
);
console.log(arrItems) // doesent works
}