I'm currently learning at the JLPT N3 level, so I'm not sure if this is something I might haven't learned about. I never knew we could put を like this.
This is a sentence from an e-dict so it should be correct.
He struck down every foe that came his way
当たるを幸い is the part which confused me. Normally it would be [[object を verb]].