I'm a Swift developer and I run the following switch statement on average which is a Double. I was using this on the iOS side.
// example average = 1.27908341230...
switch average {
case 1.0..<1.5:
//doSomething
case 0.5..<1.0:
//doSomething
case 0.0..<0.5:
//doSomething
default:
break
}
Now I'm using the code in Cloud Functions. Is this the correct way to do this in Javascript?
// example average = 1.27908341230...
switch (average) {
case 1.0 < 1.5:
//doSomething
break;
case 0.5 < 1.0:
//doSomething
break;
case 0.0 < 0.5:
//doSomething
break;
default:
break;
}