点击图片可看到更多讯息
开始使用于
- 游戏:
- Arma 3
- 版本:
- 1.56
描述
- 描述:
- Applies given code to each element of the array and returns resulting array. The value of the current array element, to which the code will be applied, is stored in variable _x.
基本句法
- 句法:
- array apply code
- 参数:
- array: Array - array of Anything
- code: Code - code to be executed on each element of the array. Current element value is stored in variable _x
- 返回值:
- Array - resulting array
范例
- 范例1:
_arr = [1,2,3,4,5,6,7,8,9,0] apply {[1,0] select (_x % 2 == 0)}; //[1,0,1,0,1,0,1,0,1,0]
- 范例2:
_arr = [1,2,3,4,5,6,7,8,9,0] apply {_x ^ _x}; //[1,4,27,256,3125,46656,823543,16777216,387420480,1]
- 范例3:
_arr1 = []; _arr1 resize 20; _arr2 = _arr1 apply {0}; //[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
额外资讯
- 多人游戏:
- -
- 也可以看看:
- setresizepushBackpushBackUniqueselectreversecountfindinforEachdeleteAtdeleteRangeappendsortarrayIntersectBIS_fnc_arrayPushStackBIS_fnc_arrayPush
注意事项
Notes
Bottom Section
- Posted on February 18, 2016 - 11:03 (UTC)
- Fusselwurm
- (to anyone else wondering, I took a minute to get it): This is Array.map() is JavaScript