In these passages in the Gospel of John, the apostle is not only acknowledging the deity of Yeshua, but recording Yeshua’s claim to be YHVH. That the Jews attempted to kill him for making this claim (John 8:59) indicates that they understood that he was applying the deific title of I AM (or YHVH) to himself.
Then said Yeshua unto them, “When ye have lifted up the Son of man, then shall ye know that I am [he (a supplied word that is not in the Greek)], and that I do nothing of myself; but as my Father hath taught me, I speak these things.… Yeshua said unto them, Verily, verily, I say unto you, Before Abraham was, I am.” Then they took up stones to throw at him. (John 8:28, 58–59)
Yeshua saith unto them, “I am [he (a supplied word)].” And Judas also, which betrayed him, stood with them. As soon then as he had said unto them, I am [he (a supplied word)], they went backward, and fell to the ground.… Yeshua answered, I have told you that I am [he (a supplied word)]: if therefore ye seek me, let these go their way. (John 18:5, 6, 8)