how to check if value is negative in javascript