GithubHelp home page GithubHelp logo

simple-nesting-v-000's Introduction

Simple Nesting Lab

Objectives

  1. Access data from a nested hash.
  2. Add data to and change data within a nested hash.

Instructions

  1. Fork and clone this lab, run the test suite with the learn command to get started.
  2. You'll be filling out the content of a series of methods that we've defined for you. All of the methods expect you to operate on the programmer_hash object, which we've already defined and included in the body of each method. Use the test suite to guide you—each test is designed to tell you how to pass it.

Keep in mind that you are expected to get these tests to pass by adding or changing information in the hash programmatically. In other words, if you're asked to, for example, change the value of a certain hash key, don't just re-write the hash with the new value! Use the methods we've learned and practiced in previous lessons.

Changing a hash like this is good, and what you should be practicing in this lab:

# good example

my_hash = {first: "i'm first!", second: "i'm second!"}
my_hash[:third] = "i'm third!"

puts my_hash
# > {first: "i'm first!", second: "i'm second!", third: "i'm third!"}

Changing a hash by simply re-defining it is not the goal of this lab:

# bad example

my_hash = {first: "i'm first!", second: "i'm second!"}
my_hash = {first: "i'm first!", second: "i'm second!", third: "i'm third!"}

Top-tip: When defining methods, return values matter! Use Pry to drop into your methods and understand what is going on, what the return is, and why tests might not be passing.

View Simple Nesting Lab on Learn.co and start learning to code for free.

simple-nesting-v-000's People

Contributors

kthffmn avatar sophiedebenedetto avatar victhevenot avatar lennhy avatar markedwardmurray avatar fs-lms-test-bot avatar deniznida avatar corasan avatar sarogers avatar octosteve avatar fislabstest avatar aviflombaum avatar changamanda avatar benjagross avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.