// The important difference between the from and of methods are that the
// latter have type annotations and the former do not.
// Since Dart generics are reified and Dart 2 is strongly typed,
// this is key to both ensuring the List/Map is correctly constructed:
List<String> foo = new List.from(<int>[1, 2, 3]); // okay until runtime.
List<String> bar = new List.of(<int>[1, 2, 3]); // analysis error
// And ensuring that the types are inferred correctly:
var foo = new List.from(<int>[1, 2, 3]); // List<dynamic>
var bar = new List.of(<int>[1, 2, 3]); // List<int>
List<double> first = [1,2,3,4,5,6,7];
List<double> second = [3,5,6,7,9,10];
List<double> output = [];
first.forEach((element) {
if(!second.contains(element)){
output.add(element);
}
});
//at this point, output list should have the answer