
Butanic
u/Butanic

I just started with JavaScript and I'm horrible with promises.
I have a function, let's call it doStuff, that makes a query to a database. I want it to return the results of the query (we'll call them result.data) to the function that called it.
function doStuff(){
let x = "";
session .run( //query parameters) .then(result => {
alert(result.data); // This properly logs the result data
x = result.data;
}) .catch(//error catching function);
return x;
}
The issue I have is that the function finishes executing and returns null before the result is processed.
Later in the execution I get an alert with the correct result data displayed, so it's not an issue with the database.
I wan
New Michigan Poll - π DIAMOND JOE 54 π, Bernie Sanders 33
realclearpolitics.com/docs/2020/Mitchell_Poll...Joe's online game is admittedly kinda weak. Winning the presidency is going to require a stronger online presence to counter the Trump-stans and the Bernie Bros. We can all help by doing a little bit every day on social media. Thoughts?
And if you hate malarkey as much as I do, help πππour boy πππ and join us at r/JoeBiden
Any ideas on how one might say Museum or Gallery in Anglish?

Study: Researchers find a remarkable ripple effect when you give cash to poor families
npr.org/sections/goatsandsoda/2019/12/02/7811...Feeling a little violated after that midterm. How about you?
Undecided general election voters prefer Biden, Yang out of Democrats
businessinsider.com/undecided-general-electio...Left my Helly Hansen rain jacket somewhere in Engg or ST, and I need it this weekend. Shoot me a DM if you saw it or know where it is. Peter Tracey bless π


