isEmpty

Summary

Checks if the array is empty and contains zero elements.

Usage

public bool isEmpty()

Returns

true if the array does not contain any elements and false otherwise.

Description

Checks if the array is empty and contains zero elements.

This method does not mutate the array.

Examples

Basic Usage
1
2
3
4
5
6
import System;
 
int[] arr1 = [];
int[] arr2 = [ 1, 2, 3 ];
Console.log(arr1.isEmpty()); // true
Console.log(arr2.isEmpty()); // false

Share

HTML | BBCode | Direct Link