Don't use `endsWith` in prototype test

Firefox already provides endsWith