I hereby claim:
- I am danielsokil on github.
- I am danielsokil (https://keybase.io/danielsokil) on keybase.
- I have a public key ASCaaK1iwB82zGy0fYaGyc6mSjthTg-vD2fcAKvs7RIXlQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
^
Start of line
$
End of line
.
Any single character except a line break.
[]
"Make it work, then make it beautiful, then if you really have to, make it fast. 90% of the time, if you make it beautiful, it will already be fast. So really, just make it beautiful." - Joe Armstrong
<templateSet group="EEx snippets"> | |
<template name="e=" value="<%= $END$ %>" description="EEx - Render Expression, replace with result" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="ELIXIR_CODE" value="true" /> | |
</context> | |
</template> | |
<template name="ee" value="<% $END$ %>" description="EEx - Expression, inline with output" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="ELIXIR_CODE" value="true" /> | |
</context> |
function gradingStudents(grades) { | |
function checkRoundedGrade(grade) { | |
if (grade < 38) return grade; | |
let gradeRounded = Math.ceil(grade / 5) * 5; | |
if ((gradeRounded - grade) < 3) return gradeRounded; | |
else return grade; | |
} | |
return grades.map(grade => checkRoundedGrade(grade)); | |
} |