The US President swung through a series of emotions as the results came in, shifting from shock at Republican losses to railing against Iran.