I want to remove the last entry in my array, and I want the array to show me that it has 1 less entry when I am using the ${#array[@]}. This is the current line
${#array[@]}
In your function, you could add the following:
target="${@:$(($#)):1}" set -- "${@:1:$(($#-1))}"