0

This question may seem duplicate but unfortunately I couldn't understand other answers.

I'm trying to assign value from callback function to parent variable.

For example

let orientation = null;
orientation = Exif.getData(image, function(){
   return "somevalue";
});

Here how can I assign "somevalue" to orientation?

she hates me
  • 1,212
  • 5
  • 25
  • 44

1 Answers1

-1

You can do it the following way:

let orientation = null;
Exif.getData(image, function(){
   orientation = "somevalue";
});
...
if(!orientation) //The callback probably did not run
Bruno Tavares
  • 450
  • 1
  • 4
  • 18