Created
January 3, 2021 15:54
-
-
Save mersanuzun/d959a570145fdcc3169caddc6cf3cf5b to your computer and use it in GitHub Desktop.
scoreCalculator.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const scorePrinter = function() { | |
const SCORES = [ | |
{score: 90, text: 'AA ile dersi gectiniz'}, | |
{score: 85, text: 'BA ile dersi gectiniz'}, | |
{score: 80, text: 'BB ile dersi gectiniz'}, | |
{score: 75, text: 'CB ile dersi gectiniz'}, | |
{score: 50, text: 'Kosullu gectiniz.'}, | |
]; | |
const print = (score) => { | |
const result = SCORES.find(noteConfig => noteConfig.score < score) || {text: 'Dersi gectiniz'}; | |
console.log(result.text); | |
}; | |
return { | |
print, | |
}; | |
}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment