fix(curriculum): ensure complete removal of myTaskArr and related loc… (#55715)

prod-current
Ujjwal 2024-09-26 20:12:24 +05:30 committed by GitHub
parent 639fe85953
commit fb6087fcd1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 25 additions and 1 deletions

View File

@ -14,7 +14,31 @@ Remove the `myTaskArr` array and all of the code for `localStorage` because you
You should remove `myTaskArr` and all the code related to `localStorage` that you've just learned.
```js
assert.notMatch(code, /const\s+myTaskArr\s*=\s*\[\s*\{\s*task:\s('|")Walk\s*the\s*Dog\1\s*,\s*date:\s*('|")22-04-2022\2\s*\}\s*,\s*\{\s*task:\s('|")Read\s*some\s*books\3\s*,\s*date:\s*('|")02-11-2023\4\s*\}\s*,\s*\{\s*task:\s('|")Watch\s*football\5\s*,\s*date:\s*('|")10-08-2021\6\s*\}\s*,\s*\]\s*;?\s*localStorage\.setItem\(('|")data\7\s*,\s*JSON\.stringify\(\s*myTaskArr\s*\)\s*\)\s*;?\s*localStorage\.clear\(\s*\)\s*;?\s*const\s+getTaskArr\s*=\s*localStorage\.getItem\(\s*('|")data\8\s*\)\s*console\.log\(\s*getTaskArr\s*\)\s*const\s+getTaskArrObj\s*=\s*JSON\.parse\(\s*localStorage\.getItem\(\s*('|")data\9\s*\)\s*\)\s*;?\s*console\.log\(\s*getTaskArrObj\s*\)\s*;?/)
assert.notMatch(code, /const\s+myTaskArr\s*=\s*\[\s*\{\s*task:\s*('|")Walk\s*the\s*Dog\1\s*,\s*date:\s*('|")22-04-2022\2\s*\}\s*,\s*\{\s*task:\s*('|")Read\s*some\s*books\3\s*,\s*date:\s*('|")02-11-2023\4\s*\}\s*,\s*\{\s*task:\s*('|")Watch\s*football\5\s*,\s*date:\s*('|")10-08-2021\6\s*\}\s*\]\s*;?\s*localStorage\.setItem\(('|")data\7\s*,\s*JSON\.stringify\(\s*myTaskArr\s*\)\s*;?\)\s*;?\s*localStorage\.clear\(\s*\)\s*;?\s*const\s+getTaskArr\s*=\s*localStorage\.getItem\(\s*('|")data\8\s*\)\s*console\.log\(\s*getTaskArr\s*\)\s*const\s+getTaskArrObj\s*=\s*JSON\.parse\(\s*localStorage\.getItem\(\s*('|")data\9\s*\)\s*\)\s*;?\s*console\.log\(\s*getTaskArrObj\s*\)\s*;?/);
```
You should remove any remaining references to `myTaskArr` anywhere in the code.
```js
assert.notMatch(code, /myTaskArr/);
```
You should remove any reference to `localStorage.getItem` for the item `"data"`.
```js
assert.notMatch(code, /localStorage\.getItem\(\s*('|")data\1\s*\)/);
```
You should remove any reference to `localStorage.clear()` from your code.
```js
assert.notMatch(code, /localStorage\.clear\(\s*\)\s*;?/);
```
You should remove any remaining references to `getTaskArrObj` anywhere in the code.
```js
assert.notMatch(code, /getTaskArrObj/);
```
# --seed--