This forum is now read-only. Please use our new forums! Go to forums
28/33 ??? pls help me :(
i dont get it
Answer 556eb18c76b8fec9eb0002e7
1 vote
// 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; }
var alice = new Person(“Alice”, 30); var billy = new Person(“Billy”, 25);
// get the difference in age between alice and billy using our function var diff = ageDifference(alice, billy)
Answer 5583ef5276b8fe662d00038f
0 votes
use ; at the end of var diff = ageDifference(alice, billy)
By Santosh senior developer at Unihalt
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency