Language: JAVA Script write a function 'keyValueDuplicates (obj) that takes an object as an argument and returns an array containing all keys that are also values in that object. Examples: obj1 = { orange: "juice", apple: "sauce", sauce: "pan" }; console.log(keyValueDuplicates (obj1)); // ["sauce"] obj2 = { big: "foot", foot: "ball", ball: "boy", boy: "scout"}; console.log(keyValueDuplicates(obj2)); // ["foot", "ball", "boy"] obj3 = { pizza: "pie", apple: "pie" pumpkin: "pie"); console.log(keyValueDuplicates (obj3)); // [] *******************************************************************/ function keyValueDuplicates (obj) { | // Your code here } /*****DO NOT MODIFY ANYTHING UNDER THIS LINE*********
Language: JAVA Script
write a function 'keyValueDuplicates (obj) that takes an object as an argument and returns an array containing all keys that are also values in that object.
Examples:
obj1 = { orange: "juice", apple: "sauce", sauce: "pan" }; console.log(keyValueDuplicates (obj1)); // ["sauce"]
obj2 = { big: "foot", foot: "ball", ball: "boy", boy: "scout"};
console.log(keyValueDuplicates(obj2)); // ["foot", "ball", "boy"]
obj3 = { pizza: "pie", apple: "pie" pumpkin: "pie"); console.log(keyValueDuplicates (obj3)); // []
*******************************************************************/
function keyValueDuplicates (obj) {
| // Your code here
}
/*****DO NOT MODIFY ANYTHING UNDER THIS LINE*********/
try {
| module.exports = keyValueDuplicates;
} catch (e) {
| module.exports = null;
}

Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images









