7 kyu
Search JSON for any key value pair
910incidental
Description:
You have a friend who works for a well known animation studio. He has heard you talk about your mad programming skills and ask for your help in writing a function that can search some JSON records and return matching character details.
He needs to be able to search for objects in the collection by any of the objects keys and return an array of all the matches.
The basic structure of the JSON object is shown below:
characters = {"characters": [
{"name":"Bill Cipher", "age":"Unknown", "speciality":"warp reality"},
// ......
]};
The JSON object is preloaded and can be accessed using the variable characters.
Your function will also need to accommodate the following:
- Passed value does not match any keys: in this instance return an empty array.
- Passed key does not exist: in this instance return an empty array.
- Passed val should not be case sensitive.
JSON
Fundamentals
Arrays
Similar Kata:
Stats:
Created | Aug 20, 2015 |
Published | Aug 20, 2015 |
Warriors Trained | 2116 |
Total Skips | 91 |
Total Code Submissions | 5440 |
Total Times Completed | 910 |
JavaScript Completions | 910 |
Total Stars | 40 |
% of votes with a positive feedback rating | 82% of 148 |
Total "Very Satisfied" Votes | 107 |
Total "Somewhat Satisfied" Votes | 29 |
Total "Not Satisfied" Votes | 12 |