Extract object value
Given an object and a property, return a value based on that property.
Sample Code:
function findVal(obj,prop) {
// Enter your logic here...
}
Examples:
Input: {lang1:'Javascript',lang2:'Python'},'lang1'
Output: 'Javascript'
Explanation: Accessing property lang1 will return the value 'Javascript'.
Input: {1:'Web Dev',2:'Data Sc'},1
Output: 'Web Dev'
Explanation: Accessing property 1 will return the value 'Web Dev'.