Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _.mixin
- array_shift: (inputArr) ->
- props = false
- shift = undefined
- pr = ''
- allDigits = /^\d$/
- int_ct = -1
- _checkToUpIndices = (arr, ct, key) ->
- #Deal with situation, e.g., if encounter index 4 and try to set it to 0, but 0 exists later in loop (need to
- #increment all subsequent (skipping current key, since we need its value below) until find unused)
- if arr[ct] isnt undefined
- tmp= ct
- ct += 1
- if ct is key then ct += 1
- ct= _checkToUpIndices(arr, ct, key)
- arr[ct]= arr[tmp]
- delete arr[tmp]
- return ct
- if inputArr.length is 0 then null
- if inputArr.length > 0 then _.array_shift(inputArr)
Add Comment
Please, Sign In to add comment