Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
/********* section 1 *********/
ExampleClass = function(){};
ExampleClass.method = function(customMsg){  
    console.log((customMsg === undefined)?
                    "I am a new method." :
                     customMsg);}
ExampleClass.method();
/********* section 2 *********/
// var someInstance = new ExampleClass();
// someInstance.method();
/********* section 3 *********/
// ExampleClass = function(){};
// ExampleClass.prototype.method = function(customMsg){  
//     console.log((customMsg === undefined)?
//                     "I am a new method." :
//                      customMsg);}
// // ExampleClass.method();
// var someInstance = new ExampleClass();
// someInstance.method('called from instance');
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
Tan-Sampro
0viewers