let weather = {
Temperature: 24, // °C
Humidity: 0.75, // 0 = 0%, 1 = 100%
Wind: {
Speed: 0.4, // m/s
Direction: 0.3563, // 0 = north, 0.25 = east, 0.5 = south, 0.75 = west
},
isFreezing() {
return this.Temperature < 0;
},
}
document.querySelector('.js-output').innerHTML = weather.isFreezing();
let anotherWeather = {
Temperature: -2, // °C
Humidity: 0.64, // 0 = 0%, 1 = 100%
Wind: {
Speed: 3.4, // m/s
Direction: 0.9352, // 0 = north, 0.25 = east, 0.5 = south, 0.75 = west
},
isFreezing() {
return this.Temperature < 0;
},
}
document.querySelector('.other-js-output').innerHTML = weather.isFreezing();