an object creates a model by grouping together a set of related variables, values and functions
an object's properties can use different value types e.g. string, number, boolean, array and even functions (if a property's value is a function, it is called a method), it can even contain other objects
you can access an object's properties using dot notation, most commonly used because it's easier to use and easier on the eyes
you can also access an object's properties using bracket notation, although less commonly used, it has a couple of advantages over dot notation
-bracket notation is the only way to access property or method names that don't follow variable naming rules (e.g. a property name like "another key" has a space inbetween)
-with bracket notation you can also access an object's property using string concatenation, although not entirely recommended
if you try to access a property that doesn't exist, undefined will be returned
• Javascript - How to Access Javascript Obje... - Javascript - How to Access Javascript Object Property Names Using Object.keys()
• Javascript - How to Access Javascript Obje... - Javascript - How to Access Javascript Object Property Names Using A for in LOOP
----------------
resources:
http://stackoverflow.com/questions/49...
-----------------------------------------------------------
http://atechapart.com | / alvinsanchez
see my codepens @ http://codepen.io/_asanchez/
Auf dieser Seite können Sie das Online-Video Javascript - How To Create a Basic Javascript Object and Access Its Properties mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer A Tech Apart 12 März 2015 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,527 Mal angesehen und es wurde von 10 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!