Methods In JavaScript

Methods are set of actions that allow the access to the variables of an object. A Method contains the code to perform some task for an/many object(s). The methods and the variables forms an object.

<head><title> Functions are like Objects </title>




function car()


var car = new Object”Lancer”


document.write(“<br> Car Name :”

document.write(“<br> Car Color :”+car.color)

document.write(“<br> Car Number :”


var mycar= car





Output is:
Car Name :Lancer
Car Color :Blue
Car Number :MAH2059


Scroll to Top