for (var i = 0; i <= 2; ++i) {
display_para(i);
};
function display_para(i){
setInterval(function(){
console.log(i);
//Stuff to be done
}, 1500 + i * 2000);
};
Expected result:
0 1 2 ; 0 1 2; 0 1 2 and so on.
Whereas it is showing different output as shown in the screenshot.
I could not understand where am I going wrong.
