“Dart peta dimana” Kode Jawaban

Peta di DART

void main() { 
   var details = new Map(); 
   details['Usrname'] = 'admin'; 
   details['Password'] = 'admin@123'; 
   print(details); 
} 

// Output
// {Usrname: admin, Password: admin@123}
Impossible Iguana

peta panah

void main() { 
   var details = new Map(); 
   details['Usrname'] = 'admin'; 
   details['Password'] = 'admin@123'; 
   print(details); 
} 
Enthusiastic Elephant

Dart peta dimana

import 'package:collection/collection.dart';
...
Map<int, String> a = {1: "a", 2: "b", 3: "c", 4: "d", 5: "e", 6: "f"};

final b = Map.fromEntries(
    a.entries.map((entry) =>
        entry.key % 2 == 0 ? MapEntry(entry.key * 10, entry.value) : null)
    .whereNotNull()
);

print(b.keys.toList()); // prints [20, 40, 60]
Wicked Wildebeest

Jawaban yang mirip dengan “Dart peta dimana”

Pertanyaan yang mirip dengan “Dart peta dimana”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya