Refactor arguments into object argument
A relatively common Javascript refactoring.
Start file
function foo(hello, world, how, are, you) { }
End file
function foo(parameters) { var hello = parameters.hello; var world = parameters.world; var how = parameters.how; var are = parameters.are; var you = parameters.you; }
View Diff
1,3c1,6 < function foo(hello, world, < how, are, < you) { --- > function foo(parameters) { > var hello = parameters.hello; > var world = parameters.world; > var how = parameters.how; > var are = parameters.are; > var you = parameters.you;
Solutions by @pradeep6kumar:
Unlock 1 remaining solutions by signing in and submitting your own entry
Created by: @blingcoder Tweet
68 active golfers, 166 entries
Solutions by @pradeep6kumar:
99
#63 - Pradeep Kumar 🇮🇳🇮🇳🇮🇳🇮🇱🇮🇱🇮🇱 / @pradeep6kumar
02/13/2013 at 04:41AM