I want to understand how to write my own async functions.
So how can I populate the array with a lot of elements async and see 'finish' line without delay, instead of waiting the population to complete ?
Here is the example of which I tried to implement Promises and callbacks but didn't succeed.
let arr = [];
populateAsync(arr);
console.log('finish');
function populateAsync(arr) {
// somehow populate arr async till it reaches
// 100000000 elements (big enough to make a delay)
}