6 kyu
range `literals`
Description:
Your function should do this:
// make an array from 0 to 5
range`5` // => [0, 1, 2, 3, 4, 5]
// make an array from 10 to 15
range`10:15` // => [10, 11, 12, 13, 14, 15]
// can be filterred
range`1:50${x => x%10 === 0}` // => [10, 20, 30, 40, 50]
and must return []
if it's not valid like these examples:
range`1:` // => [] no end
range`:5` // => [] no start
range`1:5${true}` // => [] must be a function
range`1 : 10${x => x%2===0}` // => [] contains spaces
range`1:10${()=> true}${()=> true}` // => [] multiple functions
Note:
For range`n:m`
, it'll always be 0
<= n
< m
Language Features
Similar Kata:
Stats:
Created | Jan 29, 2024 |
Published | Jan 29, 2024 |
Warriors Trained | 177 |
Total Skips | 2 |
Total Code Submissions | 357 |
Total Times Completed | 61 |
JavaScript Completions | 61 |
Total Stars | 6 |
% of votes with a positive feedback rating | 85% of 24 |
Total "Very Satisfied" Votes | 18 |
Total "Somewhat Satisfied" Votes | 5 |
Total "Not Satisfied" Votes | 1 |
Total Rank Assessments | 13 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 6 kyu |