Skip to content

Instantly share code, notes, and snippets.

@mike-duke
Last active November 2, 2018 16:46
Show Gist options
  • Save mike-duke/2348e1c5306b71c1c1db928b24e95693 to your computer and use it in GitHub Desktop.
Save mike-duke/2348e1c5306b71c1c1db928b24e95693 to your computer and use it in GitHub Desktop.

Problem

Studying array prototypes can be difficult without a level of interactivity that helps retention.

Idea

Create an application that allows a user to choose a method they want to work on, see the number of elements in the starting array, choose which arguments it might take, choose whether the method requires a callback function and what arguments that takes, select whether the method returns a value, and then see a visual representation of the output.

Wireframe

link to wireframe

Component Structure

  • Nav Bar - upon choosing a type of method, the user should see a menu drop down with a selectable list of methods of that type.
  • Code area - clickable word that will show a visual representation of the starting array. Next area will populate with the name of the method.
  • Callback - this would be conditionally rendered. The user should be able to click "Yes" or "No" in order to see get the start of a callback. They would then be prompted to select possible arguments, some of which will be required, others optional. If the callback is selected, a button will populate to represent whether the callback needs to be returned. The user will then be prompted to select what should be returned out of the callback. An incorrect selection will turn the element red, a correct one will be green.
  • Return statement - The user can choose--like with a map--what specific property of the current element will be returned (name, color, etc.) as well as the structure of the statement--as with a find or filter.
  • Output - the user should, upon getting all of the parts correct, see a visual representation of the output. Not sure yet what this should look like--colored shapes, images, etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment