Wait for Ajax call in function to end, THEN return object to an outside variable
问题 I want to use JavaScript asynchronous, as it was intended. I want to assign the recieved data/objects to as many variables as I'll need (DataModel01, DataModel02, DataModel03 and so on). The idea is that my need for API data change all the time, and I want to only have to define once where to get the data (API endpoint), and in what local variable/object to store it. The way I'm doing it, it returns the object with recieved data from the fetchDataJSON() function. However, how do I make the