Switch statement

Use this expression when you want to test multiple conditions. For instance, when you want to calculate the number of kits to be dispensed based on the weight of the subject.

var kit;
  switch (true) {
    case weight > 25: kit = 5; break;
    case weight > 20: kit = 4; break;
    case weight > 15: kit = 3; break;
    case weight > 10: kit = 2; break;
    case weight >= 1: kit = 1; break;
  }
return Number(kit);