maybe the is pretty stupid question but what is the way to go here? I would like to create a function which returns to fulfilled promises from other functions?
getStorageData(){
var result = []
this.storage.get('ipaddress').then(ip => {
result[0] = ip
this.storage.get('timestamp').then(timestamp => {
result[1] = timestamp
console.log(result)
})})
return result
}
the console output is fine but the returned value of my defined function is an empty array. How do I get the output of the console to be the returned value of my function?
Thanks!