Get version number from String in Javascript?

Posted by heffaklump on Stack Overflow See other posts from Stack Overflow or by heffaklump
Published on 2010-05-11T10:36:27Z Indexed on 2010/05/11 10:44 UTC
Read the original article Hit count: 127

Filed under:
|

I have a version number with 3 digits as a String,

var version = "1.2.3";

and would like to compare it to another version. To see if version is newer than otherversion,

var otherVersion = "1.2.4";

How would you do it?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about regex