k12
Array
k12.gradeRangeToArray(gradeRange, [returnNumbers]) ⇒ Returns an array of grades when provided a range (including sparse ranges).
Kind: static method of k12
See: arrayToGradeRange for the reverse of this function.
Important: The output when using returnsNumber=true
is not valid input for arrayToGradeRange
Param | Type | Default |
---|---|---|
gradeRange | String |
|
[returnNumbers] | Boolean |
false |
Example
// returns [ 'PK', 'K', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12' ]
Example
// returns [ 'K', '1', '2', '3', '4', '5', '6', '7', '8' ]
Example
// returns [ -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]
String
k12.arrayToGradeRange(input, [pkStr]) ⇒ Returns a grade range as a string (including sparse ranges).
Kind: static method of k12
See: gradeRangeToArray for the reverse of this function.
Param | Type | Default | Description |
---|---|---|---|
input | Array |
||
[pkStr] | String |
P |
the abbreviation to use for Pre-Kindergarten |
Example
// returns 'PK-2,3-5,6-8,9-12'
Example
// returns 'K-8'