We have many threads explaining the facts of the ficticius Nazarene.Here is something that I have learned, the number 40 is pretty used for magickal workings and the case of "Jesus praying or doing things in the desert during 40 days" is refered to a magickal working with the number 40 involved,also, Satan´s number is 4 and consider that fact of why Jesus spent "40 days in the desert", it ties Satan in that passage. Also, Jesus was tempted "3 times" and those temptations have to do with allegorical elements.
Satan means "truth" in sanskrit and Satan in those passages just told the truth and quoting the Bible/Torah,but the scenario of Jesus in the desert is fictional and just magickal/spiritual allegories involved. Jesus is a fictional character just like Batman.