London| 26-ITP-May | Martin Mwaka | Sprint 3 | Stretch#1464
Conversation
LonMcGregor
left a comment
There was a problem hiding this comment.
Good work on these stretch tasks. I have some comments
| // Pay particular attention to the following: | ||
|
|
||
| // a) How the index variable updates during the call to find | ||
| // [MM] - The index variable increments by one each time the letter (str[index]) at the current index does not match the target letter (char) |
There was a problem hiding this comment.
Tip: You don't need to include your name in comments as git keeps track of who made what changes.
| // Must have more than one type of number | ||
| const hasMultipleDistinctDigits = new Set(cardStr.split("")).size > 1; | ||
|
|
||
| return has16Digits && |
There was a problem hiding this comment.
This looks correct, but can you read the task specification again? See what the return type of the function is meant to be.
There was a problem hiding this comment.
Noted, I have updated the return type to boolean
|
|
||
| const checks = { | ||
| minLength: password.length > 4, | ||
| hasUpperCase: /[A-Z]/.test(password), |
There was a problem hiding this comment.
good use of regular expressions here
…-validator.test.js - all tests pass
|
Good that you now return a boolean. Do you understand how a ternary operator |
|
LonMcGregor
left a comment
There was a problem hiding this comment.
Good work, if you are ever returning a true/false it's good idea to see if you can directly return the boolean expression instead.
Self checklist
Changelist
I have completed sprint 3 stretch tasks in folder 4-stretch