From 9a0ac2098b8b18922d7a3ba803ac7fd7ffb62ce7 Mon Sep 17 00:00:00 2001 From: jsdevel Date: Wed, 3 Feb 2016 22:57:13 -0700 Subject: [PATCH] Unshifting instead of pushing when removing duplicates. * I don't believe this matters, but it's good to be consistent. --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 9a10df5f..ba14eff6 100644 --- a/index.js +++ b/index.js @@ -185,7 +185,9 @@ function withNoDuplicates(arr) { } seenParams[key] = true; - parameters.push(item); + // unshifting to preserve ordering. I don't believe it matters, but good to be + // consistent. + parameters.unshift(item); } while(--index > 0); return parameters;