Listing Everybody


SyntaxError: missing ) after argument list
Oops, try again. There was a problem with your syntax.

I've looked at other codes as well as my own and I don't see what's wrong. There are too many ways to do the same thing and I'm really confused. Please help.

var bob = {
    firstName: "Bob",
    lastName: "Jones",
    phoneNumber: "(650) 777-7777",
    email: ""

var mary = {
    firstName: "Mary",
    lastName: "Johnson",
    phoneNumber: "(650) 888-8888",
    email: ""

var contacts = [bob, mary];

function printPerson(person) {
    console.log(person.firstName + " " + person.lastName);

var list = function() {
var contacts = contacts.Length;
for (var i = 0; i < contacts.length; i++) {
    console.log(printPerson contacts[i]);


It says a ) is missing so it'll probably be near a ( right?

There are many combinations, it would be pointless to try to make things "click". Instead we have to compare how things differ to what we expect, that usually says a lot about what change is called for.


When you call your function within the loop remember the syntax.
ie. call the function by just typing the function's name, and putting a parameter value inside parentheses after it.
like this: functionName(parameter value).

I hope this helps you.


Instead of console.logging it within the for loop, you are required to call the earlier 'printPerson' function, using the index of the contacts as an argument, like so:

for (var i = 0, i < contacts.length, i++) {

Trying seeing if it makes any difference.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.