It's checking that its not empty. If it contains a list of elements use the first element, if its just one element use that one. Same behavior as jQuery.