Performance improvement of starts/endsWith

This is the fastest implementation of this two functions. It is similar to lodash's implementation.
http://jsperf.com/startswith-fast
http://jsperf.com/endswith-fast
Can you multi line that double ternary? do a `if {} else if` thats hard to interpret