Created
October 14, 2017 00:02
-
-
Save matt-daniel-brown/1f5452b567a702d566fdd1aed30870f7 to your computer and use it in GitHub Desktop.
Basic Javascript Stuff...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<title>My Example</title> | |
<p id="msg"></p> | |
<hr> | |
<p>The first parameter of <code>slice()</code> is a zero-based index to specify where the extraction begins. It extracts up to (but not including) the second parameter.</p> | |
<script> | |
var cities = ["Tokyo", "Auckland", "Sydney", "Brisbane", "Cairns", "London"]; | |
citiesAU = cities.slice(2, 5); | |
document.getElementById("msg").innerHTML = cities + "<br>" + citiesAU; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment