mdn/js/2_javascript_objects/0_object_basics

0_object_basics

dz / mdn / js / 2_javascript_objects / 0_object_basics

Summary

JavaScript Object Basics

Node Tree

Nodes

object
content Object
children associative_arrays, bracket_notation, collection_data_functionality, dot_notation, method, object_literal, property, this

collection_data_functionality
content Collection of data and/or functionality
parents object

property
content Property: data item
parents object

method
content Method: function that allows the object to do something with the data
parents object

object_literal
content Object Literal: object content written out literally as it is created
children useful_for_transfering_related_data
parents object

useful_for_transfering_related_data
content Useful for transfering series of related data items
parents object_literal

dot_notation
content Dot Notation
children bracket_notation (alternative), namespace
parents object

namespace
content Namespace
parents dot_notation

bracket_notation
content Bracket Notation
parents object, dot_notation

associative_arrays
content Associative Arrays
parents object

this
content this: enables use to use the same method definition for every object you create
children constructor
parents object

constructor
content constructor
children called_using_new_keyword, capitalized_type_of_object
parents this

called_using_new_keyword
content Function called using "new" keyword
parents constructor

capitalized_type_of_object
content Convention: start with capital lettert, named for type of object they create
parents constructor