I know javascript is single thread language ,and code execute line by line .if User need to call two function simultaneously how it can achieve in javascript ? Actually I know in java there is thread which run two task simultaneously can we achieve this here is my code
https://jsfiddle.net/a021oktk/
I need to call both function simutaneouly ?
oneTask();
secondTask()
function oneTask() {
for (var i = 0; i < 10; i++) {
console.log("first loop:" + i)
}
}
function secondTask() {
for (var i = 0; i < 10; i++) {
console.log("second loop:" + i)
}
}