diff --git a/benchmark/code/for.js b/benchmark/code/for.js new file mode 100644 index 0000000..ba5cf02 --- /dev/null +++ b/benchmark/code/for.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = function(arr) { + var len = arr.length; + var res = []; + + for (var i = 0; i < len; i++) { + var curr = arr[i]; + if (res.indexOf(curr) === -1) { + res.push(curr); + } + } + return res; +};