Commit 9b541197 authored by MohammadAli Keshavarz's avatar MohammadAli Keshavarz

learning how to use function constructor

parent c6362828
// Function Constructor
var john = {
name: "john",
yearOfBirth: 1990,
job: "teacher"
};
console.log(john);
var Person = function(name, yearOfBirth, job) {
this.name = name;
this.yearOfBirth = yearOfBirth;
this.job = job;
};
var mike = new Person("mike", 1991, "developer");
console.log(mike);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment