Skip to content

Commit 5589acf

Browse files
authored
refactor(curriculum): local storage and crud quiz (freeCodeCamp#58531)
1 parent ecd9582 commit 5589acf

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

curriculum/challenges/english/25-front-end-development/quiz-local-storage-and-crud/66edd3f9bef926f129990425.md

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ To pass the quiz, you must correctly answer at least 18 of the 20 questions belo
1717

1818
#### --text--
1919

20-
What does 'CRUD' stand for in the context of web development?
20+
What does CRUD stand for in the context of web development?
2121

2222
#### --distractors--
2323

@@ -39,7 +39,7 @@ Create, Read, Update, Delete.
3939

4040
#### --text--
4141

42-
Which HTTP method is commonly associated with the 'Create' operation in a RESTful API?
42+
Which HTTP method is commonly associated with the Create operation in a RESTful API?
4343

4444
#### --distractors--
4545

@@ -61,7 +61,7 @@ Which HTTP method is commonly associated with the 'Create' operation in a RESTfu
6161

6262
#### --text--
6363

64-
Which of the following 'CRUD' operations is typically performed when modifying an existing record in a database?
64+
Which of the following CRUD operations is typically performed when modifying an existing record in a database?
6565

6666
#### --distractors--
6767

@@ -149,95 +149,95 @@ How can you remove a single item from sessionStorage?
149149

150150
#### --text--
151151

152-
What operation does `JSON.parse()` perform in JavaScript?
152+
What is the difference between `PUT` and `PATCH`?
153153

154154
#### --distractors--
155155

156-
Converts a JavaScript object into a JSON string.
156+
`PUT` modifies specific fields, while `PATCH` replaces the entire resource.
157157

158158
---
159159

160-
Encodes a JavaScript object into a base64 string.
160+
`PUT` only adds new resources, while `PATCH` updates existing ones.
161161

162162
---
163163

164-
Validates if a given string is a valid JSON object.
164+
`PUT` is used for retrieving data, while `PATCH` is used for sending data.
165165

166166
#### --answer--
167167

168-
Parses a JSON string and returns a corresponding JavaScript object.
168+
`PUT` replaces the entire resource, while `PATCH` updates specific fields.
169169

170170
### --question--
171171

172172
#### --text--
173173

174-
Which of the following methods correctly converts the JavaScript object `const user = { name: "Emma", age: 35 };` into a JSON string?
174+
What is the cache storage used for?
175175

176176
#### --distractors--
177177

178-
`JSON.encode(user)`
178+
Cache storage is used to permanently store user credentials securely in the browser for authentication purposes.
179179

180180
---
181181

182-
`JSON.parse(user)`
182+
Cache storage is used to store large volumes of structured data in the browser using a database system.
183183

184184
---
185185

186-
`JSON.toString(user)`
186+
Cache storage is used to track user sessions and preferences by storing key-value pairs accessible across multiple websites.
187187

188188
#### --answer--
189189

190-
`JSON.stringify(user)`
190+
Cache storage is used to store frequently requested network resources, reducing load times and improving performance.
191191

192192
### --question--
193193

194194
#### --text--
195195

196-
Which of the following values can be directly converted to JSON using `JSON.stringify()`?
196+
What is a cookie in the context of web development?
197197

198198
#### --distractors--
199199

200-
`undefined`
200+
A type of HTTP request.
201201

202202
---
203203

204-
A Function.
204+
A piece of code that runs in the browser.
205205

206206
---
207207

208-
A DOM Element.
208+
A method to store large files on a server.
209209

210210
#### --answer--
211211

212-
An Object.
212+
A small piece of data stored by the user's web browser.
213213

214214
### --question--
215215

216216
#### --text--
217217

218-
What is a cookie in the context of web development?
218+
Which of the following methods is used to manually set a cookie in JavaScript?
219219

220220
#### --distractors--
221221

222-
A type of HTTP request.
222+
`document.setCookie`
223223

224224
---
225225

226-
A piece of code that runs in the browser.
226+
`document.cookie.set`
227227

228228
---
229229

230-
A method to store large files on a server.
230+
`document.createCookie`
231231

232232
#### --answer--
233233

234-
A small piece of data stored on the user's computer by the web browser.
234+
`document.cookie`
235235

236236
### --question--
237237

238238
#### --text--
239239

240-
Which of the following code snippets correctly deletes a cookie named 'username'?
240+
Which of the following code snippets correctly deletes a cookie named `username`?
241241

242242
#### --distractors--
243243

@@ -263,19 +263,19 @@ Which of the following statements about cookies is false?
263263

264264
#### --distractors--
265265

266-
Cookies are sent to the server with every HTTP request.
266+
Session cookies expire when the browser is closed.
267267

268268
---
269269

270-
Cookies can be accessed and modified via JavaScript.
270+
HttpOnly cookies cannot be accessed by JavaScript.
271271

272272
---
273273

274-
Cookies have a maximum size limit of around 4KB per cookie.
274+
Secure cookies are only transmitted over HTTPS.
275275

276276
#### --answer--
277277

278-
Cookies can only store string data.
278+
Cookies can only be set by the server.
279279

280280
### --question--
281281

@@ -285,63 +285,63 @@ What is browser fingerprinting?
285285

286286
#### --distractors--
287287

288-
A technique used to identify users based on their IP address.
288+
A technique used in identifying users based on their IP address.
289289

290290
---
291291

292292
A form of data encryption.
293293

294294
---
295295

296-
A way to store data in the browser's cache.
296+
A method of storing data in the browser's cache.
297297

298298
#### --answer--
299299

300-
A method of tracking users using unique attributes of their browser and device configuration.
300+
A way of tracking users through browser and device attributes.
301301

302302
### --question--
303303

304304
#### --text--
305305

306-
What is a primary risk associated with improperly stored sensitive data in client-side storage?
306+
What is a primary risk associated with storing passwords in local storage?
307307

308308
#### --distractors--
309309

310-
Data duplication.
310+
Local storage data is deleted once you close the browser tab.
311311

312312
---
313313

314-
Data compression.
314+
Local storage data is lost once you delete cookies.
315315

316316
---
317317

318-
Increased page load time.
318+
Local storage doesn't work offline.
319319

320320
#### --answer--
321321

322-
Cross-Site Scripting (XSS) attacks.
322+
Local storage is not encrypted and can be accessed easily.
323323

324324
### --question--
325325

326326
#### --text--
327327

328-
What is one way to mitigate the risk of XSS attacks affecting client-side storage?
328+
What of the following statements is true about client-side storage?
329329

330330
#### --distractors--
331331

332-
Use plain text for all data stored in localStorage.
332+
Client-side storage uses objects instead of strings to store data.
333333

334334
---
335335

336-
Increase the size limit of cookies.
336+
Client-side storage uses cloud services to sync user data across multiple devices.
337337

338338
---
339339

340-
Disable JavaScript in the browser.
340+
Client-side storage is more secure than server-side storage.
341341

342342
#### --answer--
343343

344-
Sanitize user inputs and escape outputs to prevent script injection.
344+
Client-side storage allows websites to store data on a user's device.
345345

346346
### --question--
347347

0 commit comments

Comments
 (0)