While it is useful for web apps, JavaScript in Mobile Safari is not sufficient for creating the vast majority of standalone applications.
Flash, while hardly a world-class systems programming language, is a step beyond JavaScript in several respects.
Most importantly, it is more consistently cross-platform compatible, meaning that I could actually take advantage of preexisting Flash applets on the iPhone, whereas oftimes when designing a JS app one must consider a far wider range of discrepancies between platforms. In other words, given a randomly-selected JS applet and a randomly-selected Flash applet from all available to me, the probability is greater that the Flash applet will be correct in an officially-supported Flash VM than that the JS applet will be correct in Mobile Safari.