1

Помогите найти ошибку.

var friends = new Object();

friends.steve = new Object();
steve.firstName = "Steve";
steve.lastName = "Jobs";
steve.number = "20-456-88";
steve.address = "Apple";

friends.bill = new Object();
bill.firstName = "Bill";
bill.lastName = "gates";
bill.number = "20-456-88";
bill.address = "Windows";

2 ответа 2

6

Дошло. Глупо было спрашивать.

var friends = new Object();

friends.steve = new Object();
friends.steve.firstName = "Steve";
friends.steve.lastName = "Jobs";
friends.steve.number = "20-456-88";
friends.steve.address = "Apple";

friends.bill = new Object();
friends.bill.firstName = "Bill";
friends.bill.lastName = "gates";
friends.bill.number = "20-456-88";
friends.bill.address = "Windows";

2

Вот так еще можно:

var friends = {
  steve: {
    firstName: "Steve",
    // ...
  },

  bill : {
    // ...
  },
}

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.