[JS] Minor refactoring

A predicate has been replaced by a getter