Skip to content

Instantly share code, notes, and snippets.

@yangsu
Created January 29, 2013 20:20
Show Gist options
  • Save yangsu/4667388 to your computer and use it in GitHub Desktop.
Save yangsu/4667388 to your computer and use it in GitHub Desktop.
JavaScript Object Example
var courseInfo = {
title: 'Programming Languages',
number: 'HOUSECS 59.18',
instructors: [{
name: 'Yang Su',
major: 'ECE/CS'
}, {
name: 'Kevin Gao',
major: 'ECE/CS'
}]
};
courseInfo['course-website'] = 'duke-pl-course.github.com';
courseInfo.course-website // This will result in an error
courseInfo.instructors[0].name // 'Yang Su'
courseInfo.time // > undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment