Javascript Refactoring: Extract Function

Refactoring is the process of changing the internal structure of a program without changing its functionality.  Java programmers have come to depend on automated refactoring support in the IDE.  Other languages are not so well represented.  Untyped languages do not lend themselves to automated refactorings so easily.  Javascript is one such language.  However, Javascript’s variable scoping rules make at least one refactoring pretty easy:  extract function.

Continue reading