Improve oboe-errors challenge
parent
0f943f40e2
commit
f2af5371a3
|
@ -294,7 +294,9 @@
|
|||
"function countToFive() {",
|
||||
" let firstFive = \"12345\";",
|
||||
" let len = firstFive.length;",
|
||||
" // Fix the line below",
|
||||
" for (let i = 1; i <= len; i++) {",
|
||||
" // Do not alter code below this line",
|
||||
" console.log(firstFive[i]);",
|
||||
" }",
|
||||
"}",
|
||||
|
@ -303,9 +305,9 @@
|
|||
],
|
||||
"tests": [
|
||||
"assert(code.match(/i\\s*?=\\s*?0\\s*?;/g).length == 1, 'message: Your code should set the initial condition of the loop so it starts at the first index.');",
|
||||
"assert(!code.match(/i\\s?=\\s*?1\\s*?;/g), 'message: Your code should fix the initial condition of the loop.');",
|
||||
"assert(!code.match(/i\\s?=\\s*?1\\s*?;/g), 'message: Your code should fix the initial condition of the loop so that the index starts at 0.');",
|
||||
"assert(code.match(/i\\s*?<\\s*?len\\s*?;/g).length == 1, 'message: Your code should set the terminal condition of the loop so it stops at the last index.');",
|
||||
"assert(!code.match(/i\\s*?<=\\s*?len;/g), 'message: Your code should fix the terminal condition of the loop.');"
|
||||
"assert(!code.match(/i\\s*?<=\\s*?len;/g), 'message: Your code should fix the terminal condition of the loop so that it stops at 1 before the length.');"
|
||||
],
|
||||
"solutions": [],
|
||||
"hints": [],
|
||||
|
|
Loading…
Reference in New Issue