Skip to content

Instantly share code, notes, and snippets.

View robpalme's full-sized avatar

Rob Palmer robpalme

  • Bloomberg L.P.
  • London
View GitHub Profile
// Micro-benchmark to answer the question in https://twitter.com/thejameskyle/status/905403367949647874
if (typeof console === 'undefined') console = {log:print};
var closuresOriginal = (function() {
const outer = a => {
const inner = b => a + b;
return inner(2);
};
@robpalme
robpalme / bench-sam.js
Last active August 13, 2017 16:08 — forked from bmeurer/bench-sam.js
Add aafeApplyFunctionsRest
function applyFunctionsRest(functions, ...args) {
for (var i = 0, l = functions.length; i < l; ++i) {
functions[i].apply(this, args);
}
}
var safeApply = Function.prototype.call.bind(Function.prototype.apply);
function safeApplyFunctionsRest(functions, ...args) {
for (var i = 0, l = functions.length; i < l; ++i) {