dropFirst(sequence): 返回一个去掉第一个元素的新序列(如数组)。
var languages = ["Swift", "Objective-C"]
var oldLanguages = dropFirst(languages)
equal(oldLanguages, ["Objective-C"]) == true
dropLast(sequence): 返回一个的新序列(如数组),该序列去掉作为参数传递给函数的最后一个元素。
var languages = ["Swift", "Objective-C"]
var newLanguages = dropLast(languages)
equal(newLanguages, ["Swift"]) == true
dump(object): 一个对象的内容转储到标准输出。
var languages = ["Swift", "Objective-C"]
dump(languages)
// Prints:
// ? 2 elements
// - [0]: Swift
// - [1]: Objective-C
equal(sequence1, sequence2): 如果序列1和序列2包含相同的元素,则返回true。
var languages = ["Swift", "Objective-C"]
equal(languages, ["Swift", "Objective-C"]) == true
var oldLanguages = dropFirst(languages)
equal(oldLanguages, ["Objective-C"]) == true