Comparing 2 functions - Javascript Function

Javascript examples for Function:Function Definition

Description

Comparing 2 functions

Demo Code

ResultView the demo in separate window

<html>
   <head></head>
   <body> 
      <script>
function testFn(name) {//from ww w .  j  av a2s.  com
    var self = this;
}
testFn.prototype.compareFn = function() {
  console.info(name);
};
var fn1 = new testFn('fn1');
var fn2 = new testFn('fn2');
console.log(fn1.compareFn == fn2.compareFn);

      </script>  
   </body>
</html>

Related Tutorials