Negative Values for Arguments with JavaScript substring: an Example