Is it possible to do something like this in JavaScript?
max = (max < b) ? b;
In other words, assign value only if the condition is true.
I think a better approach could be
max = Math.max(max, b)