function name() {
for (var i = 0; i < 9; i++){
yps.rot([jjjjjjj,gggggggg])
.then(function (rot) {
var Listx = rot.getLength()/1000;
var List = rot.getLength()/1000+'<br>';
$('#list').append(List);
}, function (error) {
alert('error Occurred:' + error.message);
});
alert(); //Here it should print the value of the Listx functions
}
}
function qwe(){
yps.root(data)
.then(function(){
var promise = new Promise(function(s, e){
setTimeout(function(){
// find listx
s(listx);
}, 1000);
});
return promise;
})
.then(function(listx){
// do here what you need from listx
})
}
Find more questions by tags JavaScript