What does the dot/period mean in javascript?

Question by JJ: What does the in ?
for example


what's the dot for?

Best answer:

Answer by fantabulum
It's to access either an attribute or call a method (function) of an object.
* document.title would pull the ‘title' attribute from the ‘document' object.
* document.write calls the ‘write' method on document.

To put it into perspective, I'll create my own object:
var myDog = new Object();
myDog.breed=” ”;
myDog.bark = function(){ alert(“WOOF!”); }

alert(“Name: “+myDog.name); // Alerts the name property of myDog (“Rex”)
myDog.bark(); // Calls myDog's bark method (Alerts “WOOF!”)

Know better? Leave your own answer in the comments!

Bestsellers and Hot Products

You May Also Like These Topics...

5 Tips For Training Your Golden Retriever

Question of the day: Do you think your puppy might like a “tuggotoy“? Golden were originally bred in the Scottish Highlands as hunting dogs. According to the American Kennel Club, Golden Retrievers are now the third most popular breed in the . These dogs are smart, lively, affectionate and highly adaptable. They can be […]

Need To Know Golden Retriever Info

by rkleine The is an AKC registered dog breed. The following article reviews the breed. The Golden Retriever is a sweet, lovable, attractive and fun loving dog. If you are thinking about adopting one you want to get as much Golden Retriever Information as possible. There are many different ways you can obtain […]

Golden Retriever

Click Here to Learn How Easy it is to Groom Your Dog at Home! Golden Retriever Amazon products you should keep an eye on: Golden Retriever 2 1/2 x 3 1/2 Photo FrameWant to brighten up your day? Put this adorable frame in your home or office. Depicts your holding onto to your […]

A Golden Retriever's Life 4 Art Prints Framed Numbered Signed by Randy McGovern

Golden Retriever eBay auctions you should keep an eye on: [wprebay kw=”golden+retriever” num=”38″ ebcat=”-1″] [wprebay kw=”golden+retriever” num=”39″ ebcat=”-1″] Royal Canin Dry Dog Food, Golden Retriever 25 Formula, 30-Pound BagRoyal Canin Breed Specific Formula's are engineered specifically with your special breed in mind. Each is formulated to provide d… Webkinz Golden RetrieverDiscover a virtual world with […]

Tags: , , ,
Previous Post
Golden Retriever

Woody Rubber Stick Dog Toy

Next Post
Golden Retriever

Golden Retriever 4782 Dry Dawgs 600 Gram Hunting Boots – Waterproof Nubuck Insulated (For Men) ? BROWN NUBUCK

Leave a Reply