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

Опубликовано: 09 Ноябрь 2020
на канале: 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."


Смотрите видео Basic Javascript (82/111) | Accessing Object Properties with Dot Notation | freeCodeCamp онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал Stral Tech 09 Ноябрь 2020. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 236 раз и оно понравилось 2 посетителям.