Functional Programming Principles in Scala - Lists
5.1 More Functions on Lists 앞서 보았던 것과 추가로 List의 Method 몇가지를 더 보자. Sublists and element access xs.length - The number of elements of xs. xs.last - The list's last element, exception if xs is empty. xs.init - A List consisting of all elements of xs except the last one, exception if xs is empty. xs take n - A List consisting of the first n elements of xs, or xs itselft if it is shorter than n. xs drop n - The rest of…