i'm going deeper in javascript and recently i have decided to understand asynchronous in javascript. So i studied about ten hours and read about 20 articles about call stack, callbacks, promises, async/await, event loop and even V8 engine.
now, i know js is a single-threaded, synchronous and non-blocking language and use event loop, event table and message queue to handle async behaviour.
OK! great! but finally i don't understand that what things can be async?
every Authors use setTimeout, query to DB, AJAX and fs module as example for explaining about async. but we know they are all api and they are not a part of javascript core.
so, can we execute a for loop that calculate sum of 1 billion numbers asynchronously? if yes, HOW and if no, why? can i say async behaviour is just for web api or c++ api or etc?
Promise/async/await? doesn't seem to be