Avatar

Level 2

Hello,

i want to use the following code in a javascript activity but im getting an error : 

var myPromise = new Promise(function(myResolve, myReject) {
  setTimeout(function() { myResolve("I love You !!"); }, 3000);
});

myPromise.then(function(value) {
 logInfo('Helllo Promise : '+value);
});

 

this is the error that i get :  02/04/2021 16:02:11 js7 JST-310000  ligne 2 : Promise is not defined.

 

do you have any solution please ?

Thanks in advance.