You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### 15. Write a program which can return a boolean if value is present in the range with given start and end values in an object
485
+
### 15. Write a program that can return a boolean if value is present in the range with given start and end values in an object
486
486
487
487
```js copy
488
488
// Example
@@ -507,7 +507,7 @@ range = new Proxy(range, {
507
507
508
508
---
509
509
510
-
### 16. Write a function which accepts a topic and a list of related tags to store the information. The same function should return all the topics when requested with a tagname
510
+
### 16. Write a function that accepts a topic and a list of related tags to store the information. The same function should return all the topics when requested with a tag name
### 19. Design a utility on an array of objects where the access can be made to the object using index (as usual) and also from primary key of the object
615
+
### 19. Design a utility on an array of objects where access can be made to the object using the index (as usual) and also from the primary key of the object
- The access to the index happens for arrays by default and the Proxy can be setup to enable the fetching of object using primary key (any other key can also be coded)
630
+
- The access to the index happens for arrays by default and the Proxy can be set to enable the fetching of objects using the primary key (any other key can also be coded)
631
631
632
632
```js copy
633
633
constflexEmployees=newProxy(employees, {
@@ -645,15 +645,15 @@ const flexEmployees = new Proxy(employees, {
645
645
646
646
---
647
647
648
-
### 20. Write a function which receives an object and returns a true if the object has circular reference
648
+
### 20. Write a function that receives an object and returns a true if the object has a circular reference
- Stringification of an object having circular references will throw error
656
+
- Stringification of an object having circular references will throw an error
657
657
658
658
```js copy
659
659
functiondoesObjectHaveCircularRef(obj) {
@@ -672,11 +672,11 @@ function doesObjectHaveCircularRef(obj) {
672
672
673
673
---
674
674
675
-
### 21. Write a code which can eliminate circular references in an object (Cyclic reference in an object)
675
+
### 21. Write a code that can eliminate circular references in an object (Cyclic reference in an object)
676
676
677
-
- Circular / cyclic reference exists when the object property value forms a cycle
677
+
- Circular/cyclic reference exists when the object property value forms a cycle
678
678
- The circular references can be eliminated by passing a function to take care of circular references during stringification
679
-
- The circular references can be also be eliminated by setting the such property value to null on the object itself
679
+
- The circular references can also be eliminated by setting such property value to null on the object itself
680
680
681
681
```js copy
682
682
constgetCircularReplacer= () => {
@@ -716,14 +716,14 @@ function removeCircularRef(obj) {
716
716
717
717
**Notes**
718
718
719
-
`circularReferenceObj` is assumed to be an object with cyclic reference
719
+
`circularReferenceObj` is assumed to be an object with a cyclic reference
720
720
721
721
---
722
722
723
723
### 22. Provide an object on which a value can be set to nested property even if it does not exist.
724
724
725
725
- The nested object can be accessed only if all the nested properties are defined on the object
726
-
- A proxy can designed to create such nested object properties on demand whenever such nonexistent property is requested and attempted to set with value
726
+
- A proxy can designed to create such nested object properties on demand whenever such non-existent property is requested and attempted to set with value
727
727
-`get` trap of proxy can be used to create the objects dynamically and set the value
0 commit comments