let oldArray = [1,2,3,4,5,6,7,8,9,10] let newArray = oldArray.filter({$0 >= 4}) NSLog("%@", newArray)
閉合和半閉合區間spa
for index in 1...5 { NSLog("------%d", index); } for index in 1..<5 { NSLog("------%d", index); }