Last active
June 28, 2018 10:28
-
-
Save humayunahmed8/664187c4cb47eabfabd40beb94399a38 to your computer and use it in GitHub Desktop.
Javascript Array.
This file contains 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
//Array with multiple line | |
var data=[]; | |
data[0]=10; | |
data[1]=20; | |
data[2]=30; | |
data['name']='blackdiamond'; | |
data['designation']='teacher'; | |
data['country']='USA'; | |
document.write(data[2]); | |
// call to all value using for/in loop | |
for(var a in data){ | |
document.write(data[a]+'<br/>'); | |
} | |
// array with single line | |
var data = ['Moshiur', 'Dhaka', 'Bangladesh']; | |
document.write(data[0]); | |
// Array Length | |
var meHumayun = ['Developer', 'Nizkunjara', 'Bangladesh']; | |
document.write(meHumayun.length-1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment