MOTOSHARE 🚗🏍️

Rent Bikes & Cars Directly from Owners

Motoshare connects vehicle owners with people who need bikes and cars on rent. Owners earn from idle vehicles, and renters get flexible ride options.

Visit Motoshare

Accessing Properties in JavaScript

JavaScript

Accessing Properties

A property of an object is some piece of named data it contains. These are accessed with dot
operator applied to an object alternative to the dot operator is the array [ ] operator.

Syntax: – object_name.property_name

Ex:-

Accessing Properties

Accessing Methods

Object members that are functions are called methods. These are accessed with dot operator applied
to an object alternative to the dot, the operator is the array [ ] operator.

Syntax: – object_name.Method_name( );

Ex:-

Adding Properties/Methods

Syntax:-
Object_name.Property_name = value;
Object_name[„Property_name‟] = value;

Deleting Properties

Delete operator is used to delete instance properties.

Syntax:- delete object_name.property_name
Ex: – delete fees.Rahul

After removal with delete operator, the property has the undefined value.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x