ARRAY_SIZE
Description
The ARRAY_SIZE
function is used to get the number of elements in an array, i.e., the size of the array. This function can handle arrays of various data types, including numbers, strings, booleans, etc.
Syntax
Parameter Description
array
:array<T>
type, represents the array whose size is to be calculated.
Return Type
- Returns an integer, representing the number of elements in the array.
Usage Example
- Calculate the size of a numeric array:
- Calculate the size of the string array:
- Calculate the size of an array containing boolean values: