added const to test string (#38583)

This commit is contained in:
Shaun Hamilton
2020-04-21 08:12:53 +01:00
committed by GitHub
parent 1204c72657
commit 17585b63f8

View File

@ -54,7 +54,7 @@ We've defined a function <code>countOnline</code> which accepts one argument (a
```yml
tests:
- text: The function <code>countOnline</code> should use a `for in` statement to iterate through the object keys of the object passed to it.
testString: assert(code.match(/for\s*\(\s*(var|let)\s+[a-zA-Z_$]\w*\s+in\s+[a-zA-Z_$]\w*\s*\)\s*{/));
testString: assert(code.match(/for\s*\(\s*(var|let|const)\s+[a-zA-Z_$]\w*\s+in\s+[a-zA-Z_$]\w*\s*\)\s*{/));
- text: 'The function <code>countOnline</code> should return <code>1</code> when the object <code>{ Alan: { online: false }, Jeff: { online: true }, Sarah: { online: false } }</code> is passed to it'
testString: assert(countOnline(usersObj1) === 1);
- text: 'The function <code>countOnline</code> should return <code>2</code> when the object <code>{ Alan: { online: true }, Jeff: { online: false }, Sarah: { online: true } }</code> is passed to it'