Also worth pointing out that there are 4 times as many 777s as there are A340s. Doesn’t mean A340 isn’t great, just that the odds of no accidents go up with fewer flight hours.
The popularity of A320 and 737-NG makes their safety records particularly impressive.