Swift高阶函数-contains、allSatisfy、reversed、lexicographicallyPrecedes
一、contains返回一个布尔值,指示序列的每个元素是否满足给定的条件。如果有一个满足即返回。letexpenses=[21.37,55.21,9.32,10.18,388.77,11.41]lethasBigPurchase=expenses.contains{$0>100}//'hasBigPurchase'==trueSequence协议源码@inlinablepublicfunccont