What does the dot/period mean in javascript?

array(2) { [0]=> string(0) "" ["keywords"]=> string(27) "document object,dot/period," }

Question by JJ: What does the in ?
for example

document.write

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.name=”Rex”;
myDog.color=”Yellow”;
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!


You May Also Like These Topics...

5 Tips For Training Your Golden Retriever

array(2) { [0]=> string(0) "" ["keywords"]=> string(28) ",," }

Need To Know Golden Retriever Info

array(2) { [0]=> string(0) "" ["keywords"]=> string(24) ",Golden ," }

by rkleine The Golden Retriever is an AKC registered

Golden Retriever

array(2) { [0]=> string(0) "" ["keywords"]=> string(20) "Favorite ,Golden," }

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

array(2) { [0]=> string(0) "" ["keywords"]=> string(11) ",," }

Tags: , , ,
Previous Post
s92715
Golden Retriever

Woody Rubber Stick Dog Toy

Next Post
306694
Golden Retriever

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

Leave a Reply

0 Shares
Tweet
Share
Share
Pin