Skip to content

Commit 5091ef9

Browse files
authored
Update README.md
1 parent 01e1408 commit 5091ef9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,15 +566,15 @@ Note that we chain both .replace() methods in succession such that both cases ar
566566
567567
Comparing objects can be troublesome, not to mention multi-dimensional objects/arrays. Here is something simple to help.
568568
569-
__The challenge:__ <p> - JS Objects, contrary to the way we perceive it, are simply pointers to the data stored, rather than the actual data itself. Thus, to compare objects/arrays ```a``` and ```b``` we cannot just use normal comparison operators.</p>
569+
__The challenge:__ <p> - JS Objects, contrary to the way we perceive it, are simply pointers to the data stored, rather than the actual data itself. Thus, to compare objects/arrays a and b we cannot just use normal comparison operators.</p>
570570
```js
571571
a === b //false
572572
```
573573
<p> - Use of multidimensional objects/arrays is possible, making it difficult to compare simply by iteration since we don't know the depth of a value. </p>
574574
575-
<p> - Different data types like Dates and ```undefined``` must also be taken into consideration. <p>
575+
<p> - Different data types like Dates and undefined must also be taken into consideration. <p>
576576
577-
<p>Given the above, return a boolean signifying whether ```a``` and ```b``` are equivalent in content. </p>
577+
<p>Given the above, return a boolean signifying whether a and b are equivalent in content. </p>
578578
579579
__Algorithmic Thinking:__ <p>As we would be comparing each item contained in the objects, a loop may be the first instinct to solving it. However, with the potential of multidimensional iterables, we would have to disect nested arrays in the same way when we encounter them. A combination of iteration and recursion is therefore necessary. So for each item of the array a data type check is necessary as well, to allow execution of a relevant comparison.
580580
@@ -586,6 +586,7 @@ __Algorithmic Thinking:__ <p>As we would be comparing each item contained in the
586586
587587
588588
__code Implementation:__ <p>
589+
589590
Firstly, we'll do the most simple check of ```a === b``` to avoid unnecessary complexity. This will process all of the equal literal values for us.
590591
591592
```js

0 commit comments

Comments
 (0)