Question: Make a function for result using JAVASCRIPT This method accepts a single string argument called path which describes a path to the object. This path

Make a function for result using JAVASCRIPT

This method accepts a single string argument called path which describes a path to the object. This path is structured in the following manner a[0].b.c which means it should retrieve the first element of the list called a and for that item retrieve the property b and for that property retrieve the property c. If there it is a valid path it should return the value of the last property of the path otherwise return undefined

Make a function for result using JAVASCRIPT This method accepts a single

const obj = { 'a': [{ 'b': { 'c1': 10 } }] }; console.log(obj6.result('a[@].b.c1')); // 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!