O'Reilly logo

Learning WML, and WMLScript by Martin Frost

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

max — Return the larger of two numbers

Usage

Lang.max(num1, num2)

num1 : Number

num2 : Number

Description

Returns the larger of num1 and num2. If they are equal, returns num1. The value returned has the same type as the operand.

If either num1 or num2 can’t be converted to a number, returns invalid.

Examples

Lang.max(-2, 3.4)

returns floating-point 3.4

Lang.max(17, 23)

returns integer 23

Lang.max(-3, -3.0)

returns integer -3

Lang.max(-5, false)

returns Boolean false

Lang.max("6", 6)

returns string "6"

Lang.max("six", 6)

returns invalid

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required