Why Does the F-35 Have a Machine Gun?
While the F-35 will ideally engage and destroy adversaries at range with its complement of missiles, it’s always possible that they may end up in a visual engagement in which case Lightning pilots will be very glad to have an internal gun.
See the full article at stlbeacon.org