Commit 986a78e
authored
Refactor/regex10digit (ServiceNowDevProgram#2062)
* Update script.js
- Renamed variable reg to digitLengthRegex to better reflect its purpose.
- Replaced string-based regex ('/^\d{10}$/') with a proper RegExp object.
- Added test cases for strings with 9, 10, and 11 digits to demonstrate expected behavior.
- Improved inline comments.
* Update README.md
Updated the readme to be more descriptive.1 parent 6190603 commit 986a78e
2 files changed
+18
-6
lines changedLines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | | - | |
6 | | - | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
0 commit comments