Hello
This post is a very straightforward one, basically it involves using javascript to calculate the lowest or highest number from either an array or from some definite variables.
One of the very useful possibilities of this is calculating the height and width of more than 3 columns and equalizing everything to the highest.
To achieve this we can use the Math.max() property and the Math.min() property.
This property compares all the numbers presented and extracts the highest one. It can either be used as a simple stand-alone property like this:
Or we can set up an array and use it a number array to feed numbers to it. Such an example would look like this, however i mention that i couldnt get this example to work. I learned Javascript by learning jQuery, not the other way around.
This property does exactly the opposite of what Math.max() does, as in extracting the lowest number from a set array. The code is almost identical but for keeps sake here it is
Tags: Javascript, Javascript comparing numbers
Categories: Javascript
You must be logged in to post a comment.
Recent Comments