last, each, and indexOf functions