Browse Source

Merge pull request #73 from hallzy/add_list_contains_to_docs

Added a section in lists.html for the contains method
Marco Bambini 8 years ago
parent
commit
23a007e326
1 changed files with 8 additions and 0 deletions
  1. 8 0
      docs/lists.html

+ 8 - 0
docs/lists.html

@@ -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 -->