Javascript examples for Function:Function Bind
Anonymous functions with bind
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){// w w w .java 2 s .c o m doSomething('omg',function(mark){ console.log(mark); }.bind(null, 'test')); function doSomething(printthis,callback){ console.log(printthis); callback(); } } </script> </head> <body> </body> </html>