Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

dartlang group array by key

import "package:collection/collection.dart";

main(List<String> args) {
  var data = [
    {"title": 'Avengers', "release_date": '10/01/2019'},
    {"title": 'Creed', "release_date": '10/01/2019'},
    {"title": 'Jumanji', "release_date": '30/10/2019'},
  ];


  var newMap = groupBy(data, (obj) => obj['release_date']);

  print(newMap);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #dartlang #group #array #key
ADD COMMENT
Topic
Name
7+1 =