Jump to content

Tutorial error in Accessing Object Properties


lostbits

Recommended Posts

see http://www.w3schools.com/js/js_objects.asp

 

I'm reading your tutorial and came across the following. It appears to be wrong and contradicts the examples.

 

Example1
person.lastName;
Example2
person["lastName"];
Accessing Object Properties

You can access object properties in two ways:

 

objectName.propertyName()

or

 

objectName[propertyName()]
Shouldn't this be:
objectName.propertyName
and
objectName["propertyName"]
respectively?

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...