
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Define Methods for an Object in JavaScript
Methods are the functions that let the object do something or let something is done to it. There is a small difference between a function and a method – at a function is a standalone unit of statements and a method is attached to an object and can be referenced by this keyword.
Methods are used for everything from displaying the contents of the object to the screen to performing complex mathematical operations on a group of local properties and parameters.
Here’s an example showing how to use the write() method of the document object to write any content on the document.
document.write("This is test");
Advertisements