How can I use javascript to get the highest value of two variables

javascript

Solution

Try this to get the maximum:

var result = Math.max(h1,h2)

Problem

I have two variables name `var h1` and `var h2` each holds some numbers. i want to get highest value to another variable

Original source