BT编程语言文档
map
创建一个新数组,其结果是对数组中每个元素应用一个函数的结果语法 Array.map(callback:Fn(value:Any, key:Int, current:Any))
arr = [1, 2, 3, 4] println arr.map(fn(v){ v * 2 }) // 输出:[2, 4, 6, 8]语法 Array.map(callback:Fn(value:Any, key:Int, current:Any))
arr = [1, 2, 3, 4] println arr.map(fn(v){ v * 2 }) // 输出:[2, 4, 6, 8]