0

I have something that looks like this:

let x = "";

     $("#container").croppie('result', {
        type: 'canvas',
        size: 'original',
        format: 'jpeg'
    }).then(function (response) {
        x = response;
    });

console.log(x);

x always returns Promise Pending. I know a promise is an async process, but is there a way I can make the variable equal to the response?

user2896120
  • 3,180
  • 4
  • 40
  • 100

0 Answers0