GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — JavaScript-Design-Patterns/misc/MethodChaining at master · Badacadabra/JavaScript-Design-Patterns

Expand file tree

/

MethodChaining

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

MethodChaining

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
CoffeeScript
CoffeeScript
 
 
ECMAScript
ECMAScript
 
 
TypeScript
TypeScript
 
 
README.md
README.md
 
 

README.md

Outline

Problem

In a program, we may have a lot of function calls on the same object. This often leads to repetition because it is necessary to write the reference again and again.

Solution

Method Chaining allows us to make multiple calls on the same object without repeating ourselves. This pattern is very easy to use because the only thing to do is to return the current object ("this") in all methods that are supposed to be "chainable".

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.