Joshua's question is from the human perspective, but it is the wrong question as it relates to God. We need to ask if we are on God's side. That is, are we walking in obedience to Him? Joshua at first approached the person, apparently without fear. But when he realized Who it was, he fell face down in submission and surrender. He asked for instructions and obeyed. I expect that after the encounter, he was in a state of exhilaration and joy.