Spec-Zone.ru › Dart 2

dart:core

Метод followedBy

Iterable<E> followedBy(
  1. Iterable<E> other
)

Возвращает ленивое конкатенацию этого итерируемого объекта и other.

Возвращаемый итерируемый объект будет предоставлять те же элементы, что и этот итерируемый объект, а затем — элементы other, в том же порядке, что и в исходных итерируемых объектах.

Пример:

var planets = <String>['Earth', 'Jupiter'];
var updated = planets.followedBy(['Mars', 'Venus']);
print(updated); // (Earth, Jupiter, Mars, Venus)

Реализация

Iterable<E> followedBy(Iterable<E> other) {
  var self = this; // TODO(lrn): Remove when we can promote `this`.
  if (self is EfficientLengthIterable<E>) {
    return FollowedByIterable<E>.firstEfficient(self, other);
  }
  return FollowedByIterable<E>(this, other);
}

© 2012 the Dart project authors
Licensed under the BSD 3-Clause "New" or "Revised" License.
https://api.dart.dev/stable/2.18.5/dart-core/Iterable/followedBy.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API