var h = th > ch ? th : ch;
var h = Math.max(th, ch);
The second seems clearer to me as it's showing intent rather than implementation.
I doubt there very many situations where any performance difference would make any noticable difference and it's probably implementation dependent anyway.
According to this jsperf test, an if statement is the most performant.
However, I do agree that Math.max/Math.min is more readable.
Here's a JSPerf test which lets you test it on your browser(s):
My tests on several browsers indicate that Math.min, the ternary operator and an if statement perform similarly.
For speed, there is no significant difference.
For style, Math.max is much more readable and therefore the best option.