Execute Javascript String using setTimeout
Sandeep kamboj
Posted on July 11, 2018
window.sum=0;
window.ExecuteJavascriptString = function()
{
var data = "var a=3;"+
"var b=4;"+
"sum=a+b;"+
"ShowResult()";
setTimeout(data, 1);
}
ExecuteJavascriptString();
window.ShowResult = function(){
console.log(sum);
alert(sum);
}
💖 💪 🙅 🚩
Sandeep kamboj
Posted on July 11, 2018
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
javascriptinterviewquestions JavaScript Quiz #03 — JavaScript Strings and Literals
July 2, 2023