From fc625b62296e637f2fb8c8fcef77112d8e8c7201 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 13 Aug 2018 14:25:31 +0300 Subject: [PATCH] Code styling --- snippets/rearg.md | 2 +- test/rearg/rearg.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/rearg.md b/snippets/rearg.md index 15b7f689c..bd107c1f4 100644 --- a/snippets/rearg.md +++ b/snippets/rearg.md @@ -5,7 +5,7 @@ Creates a function that invokes the provided function with its arguments arrange Use `Array.map()` to reorder arguments based on `indexes` in combination with the spread operator (`...`) to pass the transformed arguments to `fn`. ```js -const rearg = (fn, indexes) => (...args) => fn(...indexes.map(idx => args[idx])); +const rearg = (fn, indexes) => (...args) => fn(...indexes.map(i => args[i])); ``` ```js diff --git a/test/rearg/rearg.js b/test/rearg/rearg.js index 310261bf3..927d9e9da 100644 --- a/test/rearg/rearg.js +++ b/test/rearg/rearg.js @@ -1,2 +1,2 @@ -const rearg = (fn, indexes) => (...args) => fn(...indexes.map(idx => args[idx])); +const rearg = (fn, indexes) => (...args) => fn(...indexes.map(i => args[i])); module.exports = rearg;