I want to create a function that takes in an array. If the array is empty (or === 0) I want to return one string. If the array is not empty, I want to return a different string + remove+return first element of array. How do I accomplish this?
Sample
> function(ary) {
> if (ary.length === 0) {
>-return string-
>}
>else {return other string + ary.shift[0]}
>}