Tossing in an Array



I'm having trouble with the excercise 'Tossing in an Array'. I have looked and looked but I can't seem to find the problem. I get the error - "Unexpected Indentifier".

Here is the code:

var friends = {
winny: {
number: "0425141823",
address: ["21 go ■■■■ yourself lane","Adelaide"]
bill: {
firstName: "Bill",
lastName: "Clinton",
number: "0400110011",
address: ['2 Devonshire Road,','Hawthorndene','Adelaide'],
steve: {
firstName: "Steve",
lastName: "Jobs",
number: "0411001100",
address: ['11 Tallarrook Road','Hawthorndene','Adelaide']



please excuse my language haha


Take a look at object steve:

steve: {
  firstName: "Steve",
  lastName: "Jobs",
  number: "0411001100",
  address: ['11 Tallarrook Road', 'Hawthorndene', 'Adelaide']

All property: value pairs are separated using commas.

But friends is also an object, but I don't see any commas there :slight_smile:


sorry, i dont get what you mean? I already have commas in the address line?


Ok, let us assume for a second that winny, bill and steve are empty objects:

var friends = {
  winny: {} // <-- missing comma
  bill: {} // <-- missing comma
  steve: {}

You need to separate these properties using commas. Just like in the steve object.


Great, thanks heaps! Just an easy overlook by me


You're very welcome :slight_smile:


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