Pete Hegseth has been narrowly confirmed as Donald Trump’s defence secretary, with Vice President JD Vance casting the tie-breaking vote.