[TIL] > JavaScript > dot notation

Agnes Shin·2022년 5월 9일
0

Accessing properties

JavaScript provides two notations for accessing object properties.

The first and most common, is known as the dot notation.

Under dot notation a property is accessed by giving the host object's

name.

Followed by... a period (or dot) followed by... the property name

==============

Example)

shows how the dot notation is used to read from and write to a

property.

if object.foo initally held the value one,
than the value will become two after executing this statement.

**Note that if the object.foo did not already have a value, than it would be undefined.

==============

object.foo = object.foo + 1;

==============

profile
30기 신윤숙 / FE

0개의 댓글