Javascript examples for Function:Function Bind
Immediate function invocation, add binding to console.log
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w w w.j av a 2 s . c o m*/ var app = function () { var ans = { power: console.log.bind(this, 'power'), wow: console.log.bind(this, 'wow') } return ans; }(); app.power(); } </script> </head> <body> </body> </html>