Spec-Zone.ru › ColdFusion

arrayMin

Returns the smallest numeric value in an array. If the array parameter value is an empty array, returns zero. All elements must contain values that can be automatically converted to numeric values.

arrayMin(array) → returns numeric

Member Function Syntax

someArray.min()

  • CF
  • Lucee
  • BL 1.0.0+
  • See Also: ArrayMax

    Argument Reference

    array array
    Required

    An array or variable name

    Examples
    Sample code invoking the arrayMin function

    Simple example with empty array

    To get the smallest numeric value of an array

    someArray = arrayNew(1);
    writeOutput(arrayMin(someArray));

    Expected Result: 0

    Get smallest numeric value of an array

    Uses the arrayMin function to get the smallest numeric value of an array

    someArray = [23,45,87,2,4];
    writeOutput(arrayMin(someArray));

    Expected Result: 2

    Get smallest numeric value of an array using member function

    CF 11+ Lucee 4.5+

    someArray = [23,45,99,1,4];
    writeOutput(someArray.Min());

    Expected Result: 1

    © 2012–present Foundeo, Inc. and the CFDocs contributors.
    Licensed under the MIT License.
    ColdFusion is a trademark of Adobe Systems Incorporated.
    https://cfdocs.org/arraymin

    Spec-Zone.ru

    Настройки Оффлайн Что нового Помощь О нас
    Spec-Zone .ru
    спецификации, руководства, описания, API