How to convert a String to long in javascript?
问题 I have a millisecond timestamp that I need to convert from a String to long. Javascript has a parseInt but not a parseLong . So how can I do this? Thanks Edit: To expand on my question slightly: given that apparently javascript doesn't have a long type, how can I do simple arithmetic with longs that are initially expressed as strings? E.g subtract one from the other to get a time delta? 回答1: JavaScript has a Number type which is a 64 bit floating point number*. If you're looking to convert a