Questions tagged [asynchronous-javascript]

Asynchronous JavaScript is a technique to load JavaScript asynchronously using async and defer attributes or script tag injection. Not to be confused with AJAX.

164 questions
0
votes
1 answer

Unable to store result value from a tesseract function to a global variable inside an asynchronous function

I'm using tesseract JS to convert an image into text format. The conversion is successful and I'm able to print it out in the console. But I am unable to get this text outside the scope of the function. I have tried assigning the text to a global…
0
votes
1 answer

Inserts executing after transaction.commit in Knex.js

I want to execute inserts in parallel in a transaction before finishing the transaction. I used Promise.all() and bluebird promises to cancel all the promises if one failed. The problem is that the promises seem to end before the inserts are…
LeoTheDev
  • 60
  • 1
  • 7
0
votes
2 answers

Can I create my own "then()" function in Javascript and execute it?

I was going through a tutorial about Promises in Javascript. I saw usages of then() method in many places. When I wrote the below code, I saw the "then()" function under __proto__ section of the console. const myPromise = new…
user3742125
  • 617
  • 2
  • 9
  • 31
0
votes
0 answers

What Is the proper way to return a response from this promise?

I'm writing a voice-first application for the Amazon Alexa and Google Assistant platforms using the Jovo Node.js framework. I make nested http requests to an external API (the first call is to get a resource id needed as a parameter for the second…
0
votes
1 answer

Syntax Error: What's wrong with the below code

Help me resolve the below code showing syntax error. I know there is definitely some problem. How to write the below checkInventory order with the help of arrow functions. const {checkInventory} = require('./library.js'); const order =…
0
votes
1 answer

Creating div dynamically but tinyMce isn't getting loaded for the dynamically created div

My html is