how to find last child of array javascript code example Example: js array last element get .slice(-1)[0]