|
@@ -126,6 +126,13 @@
|
|
|
var v2 = list.pop(); // pop 50
|
|
|
</code></pre>
|
|
|
|
|
|
+ <h4 class="section-h4">List Contains</h4>
|
|
|
+ <p>The List class implements the contains methods as a convenient way to check for the existance of a value in a list:</p>
|
|
|
+ <pre><code class="swift">
|
|
|
+ var list = [1, 2, "Hello", 3.1415, true];
|
|
|
+ return list.contains(3.1415); // Returns: true
|
|
|
+ </code></pre>
|
|
|
+
|
|
|
<h4 class="section-h4">List Joins</h4>
|
|
|
<p>The List class implements the join method as a convenient way to
|
|
|
interpret a list as a string:</p>
|
|
@@ -133,6 +140,7 @@
|
|
|
var list = [1,2,3,4,5];
|
|
|
list.join(" + "); // Becomes: "1 + 2 + 3 + 4 + 5"
|
|
|
</code></pre>
|
|
|
+
|
|
|
</div> <!-- /row -->
|
|
|
</div> <!-- /main-content -->
|
|
|
</div> <!-- /container -->
|