Update elements_parser.js

slicing one by one, doesn't make the array bigger. so the index value is still effective.
If you slice by 0 the array grows up and so index loose meaning.