方法作为参数
dada
dada
2019-03-22
void main(List args){ var list = ["wo", "kao", "1", "20.5"]; var result = listTime3(list, times3); print(result); } listTime3(List list,String times3(String item)){ for (var index = 0; index < list.length; index ++){ list[index] = times3(list[index]); } return list; } String times3(String item) { return item*3; }
举报