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

min — Return the smaller of two numbers

Usage

Lang.min(num1, num2))

num1 : Number

num2 : Number

Description

Returns the smaller 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.min(1, -2.0)

returns floating-point -2.0

Lang.min(17, 23)

returns integer 17

Lang.min(4.0, 4)

returns floating-point 4.0

Lang.min(true, 2)

returns Boolean true

Lang.min("-1", -1)

returns string "-1"

Lang.min(42, "foo")

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