๐Ÿ“ฆ Asabeneh / JavaScript-for-Everyone

๐Ÿ“„ 12-if-else-if-else.js ยท 12 lines
1
2
3
4
5
6
7
8
9
10
11
12// if else if else
let weather = 'sunny';
if (weather === 'rainy') {
  console.log('It is raining. You need a rain coat.');
} else if (weather === 'cloudy') {
  console.log('It might be cold you need a jacket.');
} else if (weather === 'sunny') {
  console.log('Go out freely.');
} else {
  console.log('It is not raining. No need for rain coat.');
}