width - return the size of the last axis of an array
arr.width()
The width()
method returns a scalar containing
the size of the last axis of an array. For a single-dimensional
array, the length()
and
width(0
are identical. Although the
width()
intrinsic has an intuitive value for
2-dimensional array, it is also useful for arrays of higher rank.
An Int
which is the size of the last axis of
an array
TypeCheck
if arr is not an array
ArgCheck
if any arguments are passed
a = [3,4].iterate() a.width() 4 "Hello".width() 5 nil.width() Illegal type