Przeglądaj źródła

Added a section in lists.html for the contains method

Steven Hall 8 lat temu
rodzic
commit
236a7009c2
1 zmienionych plików z 7 dodań i 0 usunięć
  1. 7 0
      docs/lists.html

+ 7 - 0
docs/lists.html

@@ -125,6 +125,13 @@
 	var v1 = list.pop();	// pop 100
 	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>
        	</div> <!-- /row -->
        </div> <!-- /main-content -->
      </div> <!-- /container -->