You could also use pop if you are wanting to just ...
# suitescript
j
You could also use pop if you are wanting to just remove the last element that you added categories.pop();