-
-
Save tappleby/f1933823c52224870014 to your computer and use it in GitHub Desktop.
Destructuring vs manual access
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function foo(...args) { | |
const [state, action] = args; | |
} | |
function bar(...args) { | |
const state = args[0]; | |
const action = args[1]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
function foo() { | |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | |
args[_key] = arguments[_key]; | |
} | |
var state = args[0]; | |
var action = args[1]; | |
} | |
function bar() { | |
var state = arguments[0]; | |
var action = arguments[1]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment