Reputation: 21
I have an array which declare like this- arr = []
.
I want to check it it's empty.
I tried: count(arr)==0
, is_null(arr)
, arr==[]
and arr==""
.
Upvotes: 2
Views: 5659
Reputation: 2360
Using count
would be the the idiomatic way:
arr_is_empty {
count(arr) == 0
}
Upvotes: 4