make _closestElement function more readable

it’ll get minified anyway
LICENSE