Class Grades

A special case of a map structure for storing the number of user's grades.

Hierarchy

Constructors

Accessors

Methods

Constructors

  • Parameters

    • Optional entries: null | readonly (readonly ["F" | "S" | "C" | "A" | "B" | "D" | "SH" | "X" | "XH", number])[]

    Returns Grades

  • Parameters

    • Optional iterable: null | Iterable<readonly ["F" | "S" | "C" | "A" | "B" | "D" | "SH" | "X" | "XH", number]>

    Returns Grades

Accessors

  • get hasZeroGrades(): boolean
  • If user has zero grades in total.

    Returns boolean

Methods

  • Gets the number of grades by their type. If grade is not present sets it to default value and returns it.

    Parameters

    • key: "F" | "S" | "C" | "A" | "B" | "D" | "SH" | "X" | "XH"

      Score rank type.

    Returns number

    The number of grades of this type.

  • Converts this map to a readable JSON format.

    Returns Partial<Record<"F" | "S" | "C" | "A" | "B" | "D" | "SH" | "X" | "XH", number>>