Basic Javascript (82/111) | Accessing Object Properties with Dot Notation | freeCodeCamp

Published: 09 November 2020
on channel: Stral Tech
236
2

Basic Javascript (82/111) | Accessing Object Properties with Dot Notation | freeCodeCamp

Full playlist 👉    • Basic JavaScript (1/111) | Comment Yo...  

"There are two ways to access the properties of an object: dot notation (.) and bracket notation ([]), similar to an array.

Dot notation is what you use when you know the name of the property you're trying to access ahead of time.

Here is a sample of using dot notation (.) to read an object's property:

var myObj = {
prop1: ""val1"",
prop2: ""val2""
};
var prop1val = myObj.prop1; // val1
var prop2val = myObj.prop2; // val2
Read in the property values of testObj using dot notation. Set the variable hatValue equal to the object's property hat and set the variable shirtValue equal to the object's property shirt."


Watch video Basic Javascript (82/111) | Accessing Object Properties with Dot Notation | freeCodeCamp online, duration hours minute second in high quality that is uploaded to the channel Stral Tech 09 November 2020. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 236 times and liked it 2 visitors.