Building a Learning Tool for Compound Data Structures
One of the most challenging things about learning to work with compound data structures has been reading the nested hashes and arrays and extracting the right set of brackets to use to identify a particular value in your code. For example: movie = { title: 'The Nutty Professor', cast: [ { name: 'Eddie Murphy', characters: [ 'Sherman Klump', 'Buddy Love', 'Lance Perkins', 'Papa Klump', 'Mama Klump', 'Grandma Klump', 'Ernie Klump' ] }, { name: 'Jada Pinkett Smith', characters: [ 'Carla Purty' ] } ] } If I want to find a character, I have to reference an array inside a hash inside an array inside a hash…I think. Even that last sentence was difficult to write. ...