Javascript examples for Function:Closure
Access function in closure
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w w w . j a v a2 s . c o m*/ (new function(f, arg) { this.a = function(x) { document.getElementById('out').innerHTML += x; } })['a']('boom.'); } </script> </head> <body> <div id="out"> out: <br> </div> </body> </html>