![]() |
#2 |
Registered User
Join Date: Jan 2016
Posts: 16
|
hello friends,
Let's look at a non Javascript example to help understand objects, methods, and propreties. Consider a a pet like a cat or a dog. What are some functions or tasks that a cat object might perform? Cats eat, sleep, scratch, meow, run, hunt, and other things. In Javascript lingo, each of these verbs would be methods of the cat object. These methods would be written as: cat.eat("cat food") cat.sleep() cat.scratch("furniture") cat.meow() Notice that methods have parentheses after them and that some methods require information within the parentheses. Informaton within a method's parentheses is known as the method parameter(s). A parameter is just additional information that a method needs to do its job. In the Javascript world the write method of the document object needs to know what to write so the method has a parameter that tells it what to write. Similarly the parameter of the prompt method tells the method what to display in the dialog box.
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to Implement Interfaces in JavaScript | JavaScriptBank | Javascript | 1 | 03-30-2014 11:48 PM |
Javascript Countdown Timer redirecting Affiliate Links | JavaScriptBank | Javascript | 0 | 05-20-2013 10:29 PM |
40 Super Nice JavaScript Extensions and Plugins | JavaScriptBank | Javascript | 0 | 04-28-2013 11:14 PM |
9 Funniest JavaScript effects | JavaScriptBank | Javascript | 0 | 04-18-2013 02:13 AM |
65 Free JavaScript Photo Gallery Solutions | JavaScriptBank | Javascript | 0 | 04-15-2013 06:38 PM |