All agreed, but a crushing American defeat at Midway as intended by the IJN would have changed the course of the war dramatically.
Guadalcanal would probably have been lost and Australia isolated, and perhaps invaded. This would have led to a very different, much larger and much later Central Pacific thrust towards Japan from America without the assistance of the SWPA thrust which bogged down and drained Japan’s forces, resources and shipping.
But the end result was that America could train naval pilots and launch ships and submarines much, much faster than Japan could and would eventually defeat Japan.
Although if Japan had managed to capture Hawaii it would have put America at a significant disadvantage because of the greater distances to be covered from continental America. Even then, as long as America maintained its will to win, Japan was going to be defeated sooner or later.
The release of Pacific forces to the war against Germany would also have altered, and presumalby accelerated, that conflict on the Western Front and Mediterranean.