array: handle leading spaces correctly

use `.shift()` not `.pop()`!

this broke my app in IE haha