Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

SEI-R-2-22/u1_lab_jurassic_objects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 

Repository files navigation

Jurassic Objects Lab

Jurassic Objects

Lab Overview

In this lab, we'll practice using javascript objects by exploring the world of Jurassic Park!

Getting Started

  • Fork and Clone this repository
  • Open in VSCode
  • Create a new file called js-objects-practice.js. You'll do all your work in this file. Remember, you can test your work by typing node js-objects-practice.js in the terminal.

Lab Instructions

Movie Database (quick warmup)

Create your own JavaScript object representing your favorite movie.

Example:

const blade = {
  title: 'Blade',
  director: 'Stephen Norrington',
  actors: ['Wesley Snipes', 'Stephen Dorff', 'Kris Kristofferson'],
  releaseYear: 1998,
  duration: 120
}
  1. After you have created your movie object, console log the title of your movie using dot notation
  2. Console log the director's name
  3. Console log the release year
  4. Maybe your favorite movie came with an extended director's cut - write a statement that increases your movie object's duration by 25 minutes

Hammonds Mines

Hammond

Today we visit Jurassic Park to explore the wild world of objects! You have been brought on to manage the dig sites for Dr. John Hammond. Spared no expense, so let's get to work!

Copy and paste each of the JavaScript snippets into your JavaScript file.

Grant

Part 1

const snakewaterMontana = {
  paleontologist: 'Dr. Alan Grant',
  depth: '10 meters',
  specimen: 'Velociraptor'
}
  1. Create a variable called guestOfHonor and assign its value to the name of the paleontologist in snakewaterMontana.

  2. Access the value of the specimen key found in the snakewaterMontana object and store it in a variable called cleverGirl.

Nedry

Part 2

const nicaragua = {
  depth: '200 meters',
  annualBudget: 1500000,
  specimens: [
    'Tyrannosaurus Rex',
    'Stegosaurous',
    'Triceratops',
    'Velociraptor'
  ]
}
  1. Store the array of specimens of this site into a variable called nicaraguanSpecimens.

  2. Make a variable called favoriteSpecimen and assign its value to your favorite dinosaur within nicaraguanSpecimens ( can you do this by referencing the nicaragua object itself? )

  3. Add 250000 to the annual budget of this site.

Butts

Part 3

const hammondsMines = {
  buenos_aires: {
    depth: '400 meters',
    annualBudget: 1000000,
    specimens: ['Ankylodon', 'Brachiosaurus']
  },
  mexico: {
    depth: '350 meters',
    annualBudget: 900000,
    specimens: ['Triceratops', 'Stegosaurus']
  }
}
  1. Access the depth of John Hammond's mine in Mexico, then create an appropriately named variable to store this value.

  2. Access and log the annual budget for Hammond's mine in Buenos Aires.

  3. Access and console log the dinosaur DNA specimens found in Buenos Aires.

  4. Insert a new object called Nicaragua into hammondsMines, and create some information to add into its properties (Depth, budget, and specimens).

  5. Create three variables to store the annual budgets for each mine into them.

  6. Create a new reasonably named variable to track the total annual cost of operation for the mines by adding the previously stored budgets.

  7. Access and console log the "Stegosaurus" specimen.

Goldblum

All done! Great work!

Resources

About

Practice using JavaScript objects by exploring the world of Jurassic Park.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors