Question: Need to make function toJson(). USING JAVASCRIPT This method should return a JSON representation of the object this method is being applied to. Also check
Need to make function toJson(). USING JAVASCRIPT
This method should return a JSON representation of the object this method is being applied to.
Also check if containsProperty("z") = true

const obj3 = { a: 1, b: 2, c: [ 1, 2, 3, 4 ], d: { X: 1, y: 2, z: 3, }; console.log(obj3.toJson()); // {"a":1,"b":2,"C":[1,2,3,4], "d":{"x":1,"y":2,"z":3}} console.log(obj3.containsProperty('z')); // true
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
