Preview:
/* write the function getProperty(), which takes two arguments: 
an object and a path to the property, which you need to get from the object. 
the path to the property is a string of keys separated by dots. */

function getProperty(obj, path) {
  // write your code here
}

const object = {
  one: 1,
  two: {
    three: 3
  },
  four: 4
};

getProperty(object, 'one'); // 1
getProperty(object, 'two.three'); // 3 
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter