Skip to content

Instantly share code, notes, and snippets.

@tappleby
Created August 21, 2015 02:42
Show Gist options
  • Save tappleby/f1933823c52224870014 to your computer and use it in GitHub Desktop.
Save tappleby/f1933823c52224870014 to your computer and use it in GitHub Desktop.
Destructuring vs manual access
function foo(...args) {
const [state, action] = args;
}
function bar(...args) {
const state = args[0];
const action = args[1];
}
"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