Javascript examples for Object:Object Method
Use function source code to create a member function and display its content
<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. co m var items = []; items.push({ example: function() { if(0 > 1) { return 'true'; } else { return 'false'; } }() }); document.write(items[0].example); }); </script> </head> <body> </body> </html>