Created
August 26, 2016 12:05
-
-
Save wgkoro/76ec2c83bfb5decd022edacf967d15ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var availableVersion = 4.2; // 4.2以上を対象とする | |
var userVersion = '4.4.0.10'; | |
var numList = userVersion.split('.'); | |
var version = numList.slice(0, 2).join('.'); | |
console.log(version); // => "4.4" | |
console.info(typeof version); // => string | |
version = parseFloat(version, 10); | |
console.log(version2); // => 4.4 | |
console.info(typeof version2); // | |
console.info(version2 > availableVersion); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment