Spec-Zone.ru › ColdFusion

arrayIsEmpty

Determines whether an array is empty. Equivalent to arrayLen(). Calling this function on an array with 10 undefined elements will return false. CF MX: this function can be used on XML objects.

arrayIsEmpty(array) → returns boolean

Member Function Syntax

someArray.isEmpty()

  • CF3+
  • Lucee
  • See Also: ArrayIsDefined

    Argument Reference

    array array
    Required

    An array name or variable name

    Examples
    Sample code invoking the arrayIsEmpty function

    Simple example for arrayIsEmpty function

    To check an array is empty or not

    someArray = [1,2,3,4,5];
    writeOutput(arrayIsEmpty(someArray));

    Expected Result: No

    Simple example for arrayIsEmpty function

    Lucee 4.5+ To check an array is empty or not

    someArray = [1,2,3,4,5];
    writeOutput(arrayIsEmpty(someArray));

    Expected Result: false

    Simple example with member function

    CF 11+ Uses the member function is the same as running arrayIsEmpty.

    numberArray = arrayNew(1);
    writeOutput(numberArray.isEmpty());

    Expected Result: Yes

    Simple example with member function

    Lucee 4.5+ Uses the member function is the same as running arrayIsEmpty.

    numberArray = arrayNew(1);
    writeOutput(numberArray.isEmpty());

    Expected Result: true

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

    Spec-Zone.ru

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