(weather, weather2)
| 377 | // if else if else |
| 378 | // rainy (1), sunny (-1), overcast (0) |
| 379 | const weatherScorer = (weather, weather2) => { |
| 380 | let score |
| 381 | |
| 382 | if (weather == 'rainy' && weather2 == 'overcast') { |
| 383 | score = 2 |
| 384 | } else if (weather == 'rainy') { |
| 385 | score = 1 |
| 386 | } else if (weather == 'sunny') { |
| 387 | score = -1 |
| 388 | } else { |
| 389 | score = 0 |
| 390 | } |
| 391 | |
| 392 | return score |
| 393 | } |
| 394 | |
| 395 | // console.log(weatherScorer('rainy', 'sunny')) |
| 396 |
nothing calls this directly
no outgoing calls
no test coverage detected