Skip to content

Instantly share code, notes, and snippets.

@mersanuzun
Created January 3, 2021 15:54
Show Gist options
  • Save mersanuzun/d959a570145fdcc3169caddc6cf3cf5b to your computer and use it in GitHub Desktop.
Save mersanuzun/d959a570145fdcc3169caddc6cf3cf5b to your computer and use it in GitHub Desktop.
scoreCalculator.js
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