Skip to content

array indexes #40

Description

@khsmaxim

Отличная директива, единственное если вдруг у тебя есть в коде раширения для масива вот токого типа:

Array.prototype.getObjByValue = function(key, value) {
  if (!this) return null;
  if (!value) return null;
  for (var ii in this) {
    if (this[ii][key] == value) {
      return this[ii];
    }
  }
  return null;
};

то, возникет конфликт в позициях где масив обрабатывается как объект
for(var key in regions) { ...
в какой-то момент regions[key] возвращает функцию getObjByValue и выдает ошибку.
с for (var key=0; key<regions.length; key++) {} было бы более правильно

Спасибо

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions