A popular approach in JavaScript APIs these days is to pass a string that matches a property name as a parameter to some function. These are…