Programming-Idioms

History of Idiom 42 > diff from v9 to v10

Edit summary for version 10 :

Version 9

2015-08-20, 23:35:25

Version 10

2015-08-21, 08:00:27

Idiom #42 Continue outer loop

Print each item v of list a which in not contained in list b.
For this, write an outer loop to iterate on a and an inner loop to iterate on b.

Idiom #42 Continue outer loop

Print each item v of list a which in not contained in list b.
For this, write an outer loop to iterate on a and an inner loop to iterate on b.

Code
main()  {
  var a = [1, 2, 3];
  var b = [2, 3];

  outer: for (var v in a) {
    for (var w in b) {
      if (w == v) continue outer;
    }
    print(v);
  }
}
Demo URL
https://dartpad.dartlang.org/?source=991975ea-bbd0-4170-a6ca-c999f92b802e