Shorter code for object hasElems