function between(value,first,last) { let lower = Math.min(first,last) , upper = Math.max(first,last); return value >= lower && value <= upper ; }