Combining Data Types Lab
Last updated
Was this helpful?
Last updated
Was this helpful?
Combining data types
JavaScript (objects, arrays)
Given the folowing object...
Log Iron Man's third ability
Log all of Iron Man's abilities by looping through the array
Log whether or not Iron Man appeared in spiderManHomecoming
Wait, that's not right -- he did appear in that movie! Change the value to true without editing the object itself and log it again to verify it changed
Check if jarvis is there by calling on the jarvisAreYouThere
function
Create a data structure for createCaptain
such that...
The following code logs Captain America
The following code logs peak human strength
The following code logs i can do this all day
Create a data structure for blackWidow
such that...
The following code logs Natalia Alianovna Romanova
The following code logs Natalie Rushman
Given the following array, loop through it and log just their name.
Given the following array of arrays, use two loops to loop over each inner array and list all the mcu movies.
Switching gears, let's look at some instrument data!
Given the above object...
Log all of the following:
telecaster
santa cruz
washburn
weber
Loop through all the electric guitars and log them
Add a vocals
property to the object that includes a list of your favorite singers
In early 2017, digital archaeologists discovered a strangest, nonsensical combined data structure. Like in Raiders of the Lost Ark, they refused to look at it directly for fear of melting their faces off.
They called it "Garmonbozia" after the Twin Peaks substance that represents suffering. That substance is creamed corn.
Your mission is to console.log 'creamed corn' from deep within the bizarre structure:
Model census data for Wakanda, for example, total number of inhabitants, schools, parks, residents, and make up addresses for whatever necessary.
It's up to you how you model this data and what data structures you use, there's no 'right' answer, but try and think about what makes the most sense to you. Should it all be inside one object or split it into many objects? Try and list all the pross and cons you can think of for using one object versus creating some normalization by splitting it into many objects.
Want to do more combined datatype drills? Try out this extra lab.
If you didn't complete the object-ception lab, go back and complete it!
Practice your HTML and CSS by trying to recreate the google homepage
Try recreating the search view as well!
Sign up for CodeWars or HackerRank if you haven't already and try out some javascript challenges there!
Copyright 2018, General Assembly Space. Licensed under CC-BY-NC-SA, 4.0
Adapted from SEI-MAE