Skip to content

Clarification for Nested Objects Slides? #3

Description

@cliffordfajardo

Hi Bianca, I was reviewing one of your slides & testing it in the chrome console and was receiving a type error message for the following code on your slide.

Slide: http://slides.com/biancagandolfo/obj-arr-func#/4/27

Code that was giving me "TypeError: Cannot set property 'full' of undefined"

var box = {};       
box['innerBox'] = {};                   
box['innerBox'].full = true;
box['innerBox']['height'] = 10;         

box['innerBox2'].full = false;

Here is the code with an extra line (penultimate line) & no error.

var box = {};       
box['innerBox'] = {};                   
box['innerBox'].full = true;
box['innerBox']['height'] = 10;         

box['innerBox2'] = {};
box['innerBox2'].full = false;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions