Skip to content

Instantly share code, notes, and snippets.

@AminBusiness
Last active June 13, 2018 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AminBusiness/a1aa991b8da5f8d493d4935259e1431e to your computer and use it in GitHub Desktop.
Save AminBusiness/a1aa991b8da5f8d493d4935259e1431e to your computer and use it in GitHub Desktop.
// source https://jsbin.com
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
function main() {
var names1 = new Array(); //Create an Array object
names1[0] = "Jeff";
names1[1] = "Sandy";
names1[2] = "Taylor";
names1[3] = "Mackenzie";
names1[4] = "Chloe";
names1[5] = "Lacey";
document.write("The original array contains these names:" +
"<br>" + names1);
var firstNameInArray = names1.shift();
document.write("<br><br>The first name in the array is:" +
"<br>" + firstNameInArray);
document.write("<br><br>The names1 array now contains these names:" +
"<br>" + names1);
}
</script>
<script id="jsbin-source-javascript" type="text/javascript">function main() {
var names1 = new Array(); //Create an Array object
names1[0] = "Jeff";
names1[1] = "Sandy";
names1[2] = "Taylor";
names1[3] = "Mackenzie";
names1[4] = "Chloe";
names1[5] = "Lacey";
document.write("The original array contains these names:" +
"<br>" + names1);
var firstNameInArray = names1.shift();
document.write("<br><br>The first name in the array is:" +
"<br>" + firstNameInArray);
document.write("<br><br>The names1 array now contains these names:" +
"<br>" + names1);
}</script></body>
</html>
function main() {
var names1 = new Array(); //Create an Array object
names1[0] = "Jeff";
names1[1] = "Sandy";
names1[2] = "Taylor";
names1[3] = "Mackenzie";
names1[4] = "Chloe";
names1[5] = "Lacey";
document.write("The original array contains these names:" +
"<br>" + names1);
var firstNameInArray = names1.shift();
document.write("<br><br>The first name in the array is:" +
"<br>" + firstNameInArray);
document.write("<br><br>The names1 array now contains these names:" +
"<br>" + names1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment