很多时候我们需要用到列表或者数组并对其进行四则运算分析,这里需要我们了解如何对列表进行配对,以及如何遍历获取其中每一个元素,然后将对象类型转化为数字类型,最后通过乘积转化其结果,我们这里使用三种方式进行,一种就是map遍历,第二种为数组乘积,第三种就是进行列表的乘积,其中建立列表的方式是通过repeat的形式完成的中每一个数的单独操作。
zip(other)
Pairs the elements of two lists to create a list of two-element lists. When the input lists are of different sizes, the final list has the same size as the shortest one.
将两个列表的元素配对,以创建一个两元素的列表。当输入的列表大小不同时,最终的列表与最短的列表大小相同。
Arguments:
this:list (List)
other (List)
Returns: List
map(baseAlgorithm, dropNulls)
Map an algorithm over a list. The algorithm is expected to take an Object and return an Object.
Arguments:
this:list (List)
baseAlgorithm (Algorithm)
dropNulls (Boolean, default: false):
If true, th