Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="JavaScript Method Chaining Pattern" />
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
var google = function(valor){
    var lalala = '3';
    
    this.chrome = function(valor){
        console.log(lalala + ' ' + valor);
        return this;
    }
    this.firefox = function(valor){
        console.log(lalala + ' ' + valor);
        return this;
    }
    console.log(valor);
    return this;
};
console.log('first call');
google('testando').chrome('stack');
console.log('second call');
google('testando').chrome('stack').firefox('test');
Output

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

Dismiss x
public
Bin info
simplologiapro
0viewers