Skip to content

Instantly share code, notes, and snippets.

View rezkam's full-sized avatar
🏠
Working from home

Rez rezkam

🏠
Working from home
View GitHub Profile
// Our person constructor
function Person (name, age) {
this.name = name;
this.age = age;
}
// We can make a function which takes persons as arguments
// This one computes the difference in ages between two people
var ageDifference = function(person1, person2) {
return person1.age - person2.age;