+ 1
Javascript projects
Can anyone help me complete the javascript projects in here
10 Réponses
+ 3
you must provide description of project and your coding attempt in order to get helped ^^
+ 2
and where is your coding attempt?
0
This is the project
You are working on a Contact Manager app.
You have created the contact object constructor, which has two arguments, name and number.
You need to add a print() method to the object, which will output the contact data to the console in the following format: name: number
The given code declares two objects and calls their print() methods. Complete the code by defining the print() method for the objects
0
Man I accidentally deleted it
0
then try again: we do not provide answers if you doesn't show your attempt ;P
0
This is the only snippet I can see now
0
try it again...
0
Already I m exhausted by it that's why I was asking here
0
function contact(name, number)
{
this.name = name;
this.number = number;
this.print = print;
}
function print()
{
console.log(this.name + ": " + this.number);
}
var a = new contact("David", 12345);
var b = new contact("Amy", 987654321)
a.print();
b.print();
- 1
function contact(name, number) {
this.name = name;
this.number = number;
}
var a = new contact("David", 12345);
var b = new contact("Amy", 987654321)
a.print();
b.print();