I have a function that I would like to return 0 if a certain value is negative. I know I can achieve that in PHP by using the max($value, 0) function; is there a JavaScript or jQuery function that provides similar functionality?
I have a function that I would like to return 0 if a certain
Share
You can use
Math.max(value, 0).