I'm confused as why one, two and three are printed even after encountering an error.
Here's the code:
setTimeout(() => {
console.log("one");
}, 1000);
setTimeout(() => {
console.log("two");
}, 2000);
setTimeout(() => {
console.log("three");
}, 3000);
console.log(neha);
I was expecting just an error without printing set timeout values as per my knowledge js engine runs console.log first and then set timeout after their particular timeframe. Correct me if I am wrong and I am new to Stackoverflow too. It's my first question.

setTimeoutinserts a new message into the queue of the event loop. Each message is processed and if an error occurs, the execution of this concrete message is stopped but the execution (processing) of the messages in the queue goes on.Update:
I just found out that there is already a related question with a lot of great answers here Understanding the Event Loop