I’ve got 2 variable
V1 = 2.2.0
V2 = 2.1.0
What I need to do is to check if v1 is greater than V2
I know that I need to check digit
I’m doing this :
first = v1.split(‘.’);
second = v2.split(‘.’);
For(i=0;i<first.length;i++){
if(first[i] > second[i]){
console.log(« superior »);
} else{
console.log(« error »);
}
}
Is it good ? I just need to check if v1 is > v2