Methods

The things that objects can do are called methods. Cats purr, computers crash, and bicycles roll. JavaScript objects also have methods: buttons click(), windows open(), and text can be selected(). The parentheses signal that we’re referring to a method, rather than a property.

✓ Tip

  • It might help to think of objects and properties as nouns, and methods as verbs. The former are things, and the latter are actions that those things can do, or have done to them.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.61.107