Object constructor : Constructor « Object Oriented « JavaScript Tutorial






<html>
<head>
<script language="Javascript" type = "text/javascript">
<!--
function EmployeeObj (name, address, phone, email) {
    this.name = name;
    this.address = address;
    this.telephone = phone;
    this.emailaddress = email;
}
var newCust = new EmployeeObj("FirstName, LastName", "city, state", "555-555-5555", "fl@website.com");

alert("Hello " + newCust.name);
//-->
</script>
</head>
<body>
</body>
</html>








25.3.Constructor
25.3.1.Constructor Paradigm
25.3.2.Object constructor
25.3.3.Constructor Example
25.3.4.Constructor prototype
25.3.5.Use Form input data to construct an object
25.3.6.Class factory example