diff --git a/index.js b/index.js index 6d5b04f..59b01c9 100644 --- a/index.js +++ b/index.js @@ -74,8 +74,7 @@ function ArrayList (limit) { if (isNill(elem)) throw ArrayListError('ENOELEM', 'Provide a valid element') if (list.isFull()) throw ArrayListError('ENOADD', "It's full.") - list[index] = elem - ++index + list[index++] = elem return list } })