Most Javascript Questions Asked in Interview | PART 2 1. What is difference between a for loop and for Each loop Ans: A for loop is traditional loop that uses a counter variable to iterate over an array. ForEach loop is a method that iterate over an array and execute a callback function for each element.forEach loop is more concise but it can be slower and less flexible than traditional for loop. 2. How does javascript handle asynchronous programming. Ans: javascript uses callback to handle asynchronous programming , javascript also support promises and async await syntax which provides more concise and readable way of handling asynchronous code. 3.what is callback function. Ans: Callback is a function that is passed as an argument to another function and is executed when a specific operation is completed.
Download the medial app to read full posts, comements and news.