Skip to content

Commit 0a691bb

Browse files
author
Sadanand Pai
committed
numbering fix
1 parent 25059e6 commit 0a691bb

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

challenges/collections-concepts.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ Object.prototype.toString.call(arr) === '[object Array]'
214214

215215
<br />
216216

217-
#### Q9
217+
#### Q7
218218
### Show how an array in JavaScript can act like a stack and queue
219219

220220
- Stack is a 'Last In First Out' data structure can be achieved using `push` and `pop` operations
@@ -238,7 +238,7 @@ arr.shift();
238238

239239
<br />
240240

241-
#### Q16
241+
#### Q8
242242
### Create an array by removing all the holes of the array
243243

244244
- Holes are `undefined` value present inside array
@@ -253,7 +253,7 @@ Holes can be formed when an array value by index is deleted. Example: `delete ar
253253

254254
<br />
255255

256-
#### Q21
256+
#### Q9
257257
### Optimize the given statements having lot of logical checks to use a compact and cleaner logic
258258
```js
259259
// Example1
@@ -286,7 +286,7 @@ Generally this use case can be implemented for `if` conditions
286286

287287
<br />
288288

289-
#### Q22
289+
#### Q10
290290
### Write a program to iterate over a 2 dimensional array and print all the values of it
291291

292292
- Arrays can be iterated by using its index to fetch the values
@@ -322,7 +322,7 @@ arr.forEach(rowArr => rowArr.forEach(val => console.log(val)));
322322

323323
<br />
324324

325-
#### Q23
325+
#### Q11
326326
### Write a program to store values in to a set
327327

328328
- Set lets us store unique values of any type
@@ -349,7 +349,7 @@ set; // 1, 2, 3
349349

350350
<br />
351351

352-
#### Q24
352+
#### Q12
353353
### Write a program to store values in to a map
354354

355355
- `Map` holds key-value pairs and remembers the original insertion order of the keys
@@ -378,7 +378,7 @@ Unlike objects, `Map` can have any primitive or object as the key
378378

379379
<br />
380380

381-
#### Q25
381+
#### Q13
382382
### Write a code to iterate over a set
383383

384384
- `set` is an iterable object and can be iterated using for..of loop
@@ -394,7 +394,7 @@ set.forEach(value => console.log(value));
394394

395395
<br />
396396

397-
#### Q26
397+
#### Q14
398398
### Write a code to iterate over a map
399399

400400
- `map` is an iterable object and can be iterated using for..of loop
@@ -414,7 +414,7 @@ map.forEach((value, key) => console.log(key, value));
414414

415415
<br />
416416

417-
#### Q27
417+
#### Q15
418418
### Show how map is different from object to store key value pairs with coding example
419419

420420
- Map does not contain any keys by default unlike objects which has keys from its prototype
@@ -436,7 +436,7 @@ Maps perform better than objects in most of the scenarios involving addition and
436436

437437
<br />
438438

439-
#### Q36
439+
#### Q16
440440
### Write a program to polyfill `filter` functionality of the Array
441441

442442
- `filter` iterates over the all values of array and passes value, index and array (itself) as the arguments
@@ -466,7 +466,7 @@ The solution is a simple polyfill of `filter` and not intended to handle all the
466466

467467
<br />
468468

469-
#### Q37
469+
#### Q17
470470
### Write a program to polyfill `map` functionality of the Array
471471

472472
- `map` iterates over the all values of array and passes value, index and array (itself) as the arguments
@@ -493,7 +493,7 @@ The solution is a simple polyfill of `map` and not intended to handle all the co
493493

494494
<br />
495495

496-
#### Q38
496+
#### Q18
497497
### Write a program to polyfill `reduce` functionality of the Array
498498

499499
- `reduce` iterates over the all values of array and passes value, index and array (itself) as the arguments

0 commit comments

Comments
 (0)