Created
May 22, 2020 10:44
-
-
Save michhub-dev/e36d394d8a022791675db4d65fb27292 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/yerudug
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> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
var myArray =[]; | |
var newArray = [23, "i'm liking js", true]; | |
var anotherOne = ["micky", "david", "miky", "dav"]; | |
var mug = { | |
name: "joe", | |
midName: "john" | |
}; | |
var sim = 10; | |
var mugArray = [sim, "cup", "soup", false, mug]; | |
mugArray[4].midName = "micky"; | |
mugArray[0]= 30; | |
//concatnate two element | |
anotherOne.concat(mugArray); | |
//look for a value in the array | |
mugArray.indexOf(mug); | |
//add a new elememt to the array | |
anotherOne.push("cup"); | |
//remove last element | |
anotherOne.pop(); | |
//remove the first element | |
anotherOne.shift(); | |
//iterate over an element | |
var upperAnotherOne = []; | |
function upperCaseElement (func, intex, aroy){ | |
upperAnotherOne.push(func.toUpperCase()); | |
} | |
anotherOne.forEach(upperCaseElement); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">var myArray =[]; | |
var newArray = [23, "i'm liking js", true]; | |
var anotherOne = ["micky", "david", "miky", "dav"]; | |
var mug = { | |
name: "joe", | |
midName: "john" | |
}; | |
var sim = 10; | |
var mugArray = [sim, "cup", "soup", false, mug]; | |
mugArray[4].midName = "micky"; | |
mugArray[0]= 30; | |
//concatnate two element | |
anotherOne.concat(mugArray); | |
//look for a value in the array | |
mugArray.indexOf(mug); | |
//add a new elememt to the array | |
anotherOne.push("cup"); | |
//remove last element | |
anotherOne.pop(); | |
//remove the first element | |
anotherOne.shift(); | |
//iterate over an element | |
var upperAnotherOne = []; | |
function upperCaseElement (func, intex, aroy){ | |
upperAnotherOne.push(func.toUpperCase()); | |
} | |
anotherOne.forEach(upperCaseElement);</script></body> | |
</html> |
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
var myArray =[]; | |
var newArray = [23, "i'm liking js", true]; | |
var anotherOne = ["micky", "david", "miky", "dav"]; | |
var mug = { | |
name: "joe", | |
midName: "john" | |
}; | |
var sim = 10; | |
var mugArray = [sim, "cup", "soup", false, mug]; | |
mugArray[4].midName = "micky"; | |
mugArray[0]= 30; | |
//concatnate two element | |
anotherOne.concat(mugArray); | |
//look for a value in the array | |
mugArray.indexOf(mug); | |
//add a new elememt to the array | |
anotherOne.push("cup"); | |
//remove last element | |
anotherOne.pop(); | |
//remove the first element | |
anotherOne.shift(); | |
//iterate over an element | |
var upperAnotherOne = []; | |
function upperCaseElement (func, intex, aroy){ | |
upperAnotherOne.push(func.toUpperCase()); | |
} | |
anotherOne.forEach(upperCaseElement); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
practice lessons on arrays