aboutsummaryrefslogtreecommitdiff
path: root/lib/helpers.js
diff options
context:
space:
mode:
authorSherman Mui <[email protected]>2015-06-04 11:43:49 -0700
committerSherman Mui <[email protected]>2015-06-04 11:43:49 -0700
commitaa242f7a4bf0cfd15ebcb7f5dcd799d27de6792b (patch)
tree49e461fef45f4d1f748cd2b9cf5e5ae0664a3564 /lib/helpers.js
parenta6c857f5b442d20182e64cf4f859e114d29a6786 (diff)
downloadfaker-aa242f7a4bf0cfd15ebcb7f5dcd799d27de6792b.tar.xz
faker-aa242f7a4bf0cfd15ebcb7f5dcd799d27de6792b.zip
Fix issue Marak/faker.js#214 with shuffle()
Add a dubious spec.
Diffstat (limited to 'lib/helpers.js')
-rw-r--r--lib/helpers.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/helpers.js b/lib/helpers.js
index 99a02e27..b4ef2248 100644
--- a/lib/helpers.js
+++ b/lib/helpers.js
@@ -39,7 +39,7 @@ exports.replaceSymbolWithNumber = function (string, symbol) {
// takes an array and returns it randomized
exports.shuffle = function (o) {
o = o || ["a", "b", "c"];
- for (var j, x, i = o.length; i; j = faker.random.number(i), x = o[--i], o[i] = o[j], o[j] = x);
+ for (var j, x, i = o.length-1; i; j = faker.random.number(i), x = o[--i], o[i] = o[j], o[j] = x);
return o;
};