Вторая программа: «Время прогулки»

Оцените, пожалуйста, код.
let temperature = 20;
let isRaining = true;
let minutes = 0;

if (!isRaining) {
if (temperature >= 10 && temperature < 15){
minutes = 30;
};
if (temperature >= 15 && temperature < 25) {
minutes = 40;
};
if (temperature >= 25 && temperature <= 35) {
minutes = 20;
};
} else {
minutes = 0;
};

А я решил через модуль числа, т.к. условие “отклонение” в ту или иную сторону - это и есть модуль.

let temperature = 20;
let itsRaining = false;
let idealTemperature = 20;
let difference = Math.abs ( idealTemperature - temperature );
let minutes;

if ( itsRaining || temperature < 0 || temperature > 35 ) {
minutes = 0;
} else if ( temperature == idealTemperature ) {
minutes = 20;
} else minutes = idealTemperature - difference;

let temperature = 20;
let isRaining = true;
let minutes = 0;

if (!isRaining && (temperature >= 15 && temperature < 25)) {
minutes = 40;
} else if (!isRaining && (temperature >= 25 && temperature <= 35)) {
minutes = 20;
}
else if (!isRaining && (temperature >= 10 && temperature < 15)) {
minutes = 30;
}
else {
minutes = 0;
}