True our equipment wasn't up to Japanese standards, but remember our naval aviators had already effectively engaged Japanese fleet carriers in Coral Sea. Moreover the fact that we knew the Japanese were coming and approximately where gave us the initiative and more than made up for any deficiency in hardware.
But, again, worse for the Japanese they had committed two cardinal sins of dividing their superior forces and failure to focus on a single objective.
True, one of the main outcomes of having broken the codes were that we knew the attack on the Aleutians was a diversion to try and suck our forces there instead of to Midway, their objective was to capture Midway, not take out our carriers, they expected no carrier resistance from us. Fortunately our people were smart enough to figure that out and so we won the day, thanks to the brave crews who gave their lives and the the other crews who continued to fight even as they faced almost certain death.
The American fighting man of WWII had no equal.