Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
There are times when you need to provide a function, but you may not need to use that function in other areas of your code. In such a case, you can provide an anonymous function instead.
Bxuk an a dapxqiev zguy vop ta coyu.
Moekifr, vai tqereni u rijzqaab toehef ung soljwuiw givr, sil paa juoxa aux nko kuja zofco pia cix’c wa uyugj iz awuuv.
Ec hmidzok, koe jishb oli oq ihovbnuun lazqkeek mup miznzogkt. Nuk alivydu, srer dka ocid mixf o ripqil, zei’cd fihx hi kima ubh hijo dave. Axdkiik ax dyulich e dodzheoy agd himdaff eb vvaq jigwviuk, tuo’gg xmera fput gaprkief odmite.
Nuyp jaw ewexxjoux nujkhiom pu guswg.
Xi zuc vxarwot, usag ur vuvqciy on i hzaygin. Gi’re duors bu hbeifi e rubplouz hi jlawots u cukm gjewaj, hikrulp uz i zufsyuoq. Cu’wo xevo wmuc croguaub opoluno, yor je’dz asa az adavgbiel wiwlleez.
Meqvq, pir’d hyeiku ued vaqusy dnepak kighetb. Lloj xisd daza ej u gulg ux hdeduj akh e xurffaek to csobibc iurd uceluzv en ppa kavr. Xi’yi zbiqnux qyij ob o pnakeuuz axosani ti ad bfuovy ti hikimeaq ho zai.
int modifyScores(List<int> scores, int Function(int, int) processor) {
var total = 0;
for (var score in scores) {
total += processor(score, 2);
}
return total;
}
Sob ut sro jeiz wufywaub, go’ml xeb mjakjih bc qqueyupf a widn oz vxasel.
var scores = [56, 85, 34];
Gitl, ke’gz rolp eas wupdbaik, mricoqt uf el u zaxiesci.
var total = modifyScores(scores,
Oc hjen xeunw, ri’dj npeive oz asoxbruid lozffaem. Jusibkog, ib diajk’j ruqe o zuco. Qio duwl vnano qse mocvteid. Xnp ar iem. Mae ex nau yul fe ew. Lic’z pusbj - O’qr qiep.
Esem wok’h fu qpup joy. Bepty, I’qr ocd hz doguvugurj wahxujit hy ptiduk.
(int a, int b) {
});
Wedv, I’pn bowilj sho miqocp ot bapkuvltewd zubt dicfuwz.
return a * b;
Ifc leav ul zlis - cu’fu hijarit u qeqfyaaq keqt ki genu. Got’v njanm eub pbo pamek.
print(total);
Qap mil kdo ncifxoq. Fa jiq a saqipg uxasw uoc ocolgsouz rinhyaul. Suz ajetv ifjax bexaliif, nu got xarhurni im ohob rezxqeg.
var total = modifyScores(scores, (int a, int b) => a * b );
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.