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

How to check properties on objects in JavaScript?

JavaScript

Check Properties exist

  • Check Properties exist

Syntax:- if (typeof object_name.key !== „undefined‟)

Ex:-

Check Properties exist

  • in operator

Syntax: – if („key‟ in object_name)

Ex:-

Check Properties exist

  • hasOwnProperty ()

Syntax: – if (object_name.hasOwnProperty(“key”))

Ex:-

0 0 votes
Article Rating
Subscribe
Notify of
guest

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