Properties Of Object in JavaScript

Properties are variables having values desired for an object and these variables determines the behaviour of that object. The variable can have different types of data .The type of data determines the type of variable. What an object contains is actually it’s properties or variable used for it. The propertiesof an object can be changed by using a method.
 
Example
 
<html>

<head>

</head>

<body>

<script>

var car = new Object

car.name=”Ferari”

car.color=”red”

car.no=”DEL1504″

document.write(“<br> Car Name :”+car.name)

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

document.write(“<br> Car Number :”+car.no)

</script>

</body>

</html>

 
Output is:

Car Name :Ferari
Car Color :red
Car Number :DEL1504

Scroll to Top