Asynchronicity in JavaScript

When things can happen independently of the programs main thread, we're talking about asynchronicity. By default JavaScript is a synchronous single threaded language which means it cannot run multiple threads parallelly. Your code will be executed from top to bottom, one after another. But what if you need to do some heavy computation on client side or just to wait for a long server response?