Console.log is not a function (who knew!)


Hello everybody,

I need help with my code, namely the "listing everybody" exercise. When I submit it I always get the error message "TypeError: console.log is not a function" and I have no idea why. The only console.log in the code is that from the previous exercise and there it worked perfectly well. I tried commenting out various sections including the console.log one but that also didn't give me any real insight into what's wrong.

Below is my code

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);
function list(){
   for(var i=0;i<contacts.length;i++){

I would really appreciate if anyone could tell me what's wrong, it's driving me nuts!

Thanks a lot


Try refreshing the page.


Of course, the one thing I wouldn't think of.... Thank you very much, it worked!


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