A simple list of anything field returns "properties.list.length is not a funtion"

Hey @keith, I’m curious if there’s a reason the list checks are done in 2 separate if statements and in that particular order. If List is null, won’t the first if statement throw an error?

Also, is there any reason the checks couldn’t be done in a single if block like the following?

if (!List || List.length() < 1 || !List.hasOwnProperty('get')) {
   return returnList;
}

Thanks for the clarification (and the helpful code snippets).

-Steve

1 Like