Question 25
Consider the following Script “script.js” embedded in an HTML document, “index.html” and an external script “app.js” given below.
Filename: index.html
<html lang="en"><head></head><body> <script src="./script.js"></script></body></html>Filename: script.js
function loadScript(src, cbf){ let script = document.createElement('script'); script.src = src; script.onload = () => cbf(); document.head.append(script);}
let cbf = function(){ console.log("callback function executed here."); extFunc()}
loadScript("./support_m6.js", cbf)extFunc()Filename: app.js
console.log("Now I am loaded, let's support")
function extFunc(){ console.log("loaded and run from external script")}What will be the output on console, if the HTML document is rendered using a browser?