MCPcopy Create free account
hub / github.com/CleverProgrammers/JavaScript-Course-by-Clever-Programmer- / weatherScorer

Function weatherScorer

playground.js:379–393  ·  view source on GitHub ↗
(weather, weather2)

Source from the content-addressed store, hash-verified

377// if else if else
378// rainy (1), sunny (-1), overcast (0)
379const 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected