Joshua did as Moses had told him and fought against Amalek, while Moses, Aaron, and Hur went up to the top of the hill.
In context
8Then Amalek came and attacked Israel at Rephidim. 9Moses said to Joshua, “Choose some men for us, and go out and fight against Amalek. Tomorrow I will stand on top of the hill with the staff of God in my hand.” 10Joshua did as Moses had told him and fought against Amalek, while Moses, Aaron, and Hur went up to the top of the hill. 11Whenever Moses raised his hand, Israel prevailed, and whenever he lowered his hand, Amalek prevailed. 12When Moses’ hands grew heavy, they took a stone and put it under him, and he sat on it, while Aaron and Hur held up his hands, one on each side, so that his hands remained steady until the sun went down.