当我在Swift中过滤数组时,我可以期望结果与原始数据的顺序相同吗?例如,我可以指望:
[3, 1, 4, 1, 5, 9, 2, 7].filter{$0 > 4}
总是回来:
[5, 9, 7]
?
arrays swift
arrays ×1
swift ×1