Synchronous
Synchronous is execute the code line by line.
Synchronous is wait for the one action complete and block the other action to perform.
<body>
<Script>
// synchronous in Java Script
console.log("Selva");
console.log("kumar");
console.log("Ramesh");
</Script>
</body>
Output:
ASynchronous:
ASynchronous is not waiting for the execution of one function complete
<body>
<script>
console.log("Selva");
setTimeout(() => {
console.log("Kumar")
}, 1000);
console.log("Ramesh");
</script>
Output:
Top comments (0)