gradeAtLeastfunction
Whether a grade is at least as good as another: A is at least B, and B is at least B, but C is not at least B.
Import it
import { gradeAtLeast } from "@johnmorrisdotca/hoshi-stars/accuracy";
Definition
function gradeAtLeast(grade: StarGrade, minimum: StarGrade): boolean
Parameters
| Name | Type | Description |
|---|---|---|
grade | StarGrade | The grade to test. |
minimum | StarGrade | The worst grade that is accepted. |
Returns
boolean
true when grade is minimum or better.
Examples
import { gradeAtLeast } from "@johnmorrisdotca/hoshi-stars/accuracy";
console.log(gradeAtLeast("A", "B"), gradeAtLeast("C", "B")); // true falsetrue falseWhat it prints (run when this page was built)