Javascript Data Structure Array

1
22
Javascript Data Structure Array

Javascript Data Structure Array

var item = [“a”,”b”,”c”,”d”];
undefined
item
(4) [“a”, “b”, “c”, “d”]0: “a”1: “b”2: “c”3: “d”length: 4__proto__: Array(0)
item[3]
“d”
item[2];
“c”
var number = [“1″,”2″,”3″,”4”];
undefined
number
(4) [“1”, “2”, “3”, “4”]0: “1”1: “2”2: “3”3: “4”length: 4__proto__: Array(0)
var boolean = [true,false];
undefined
boolean
(2) [true, false]
boolean[1]
false
var mitem = [“a”,3,true];
undefined
item
(4) [“a”, “b”, “c”, “d”]
mitem
(3) [“a”, 3, true]0: “a”1: 32: truelength: 3__proto__: Array(0)
var item = [“A”,”B”,”C”,”D”];
undefined
var item = [[“A”,”B”,”C”,”D”]];
undefined
item
[Array(4)]0: (4) [“A”, “B”, “C”, “D”]length: 1__proto__: Array(0)
var item = [“A”,”B”,”C”,”D”];
undefined
item
(4) [“A”, “B”, “C”, “D”]
item.shift();
“A”
item
(3) [“B”, “C”, “D”]
item.pop();
“D”
item
(2) [“B”, “C”]
item.push(“e”);
3
item
(3) [“B”, “C”, “e”]0: “B”1: “C”2: “e”length: 3__proto__: Array(0)
item.push(“f”,”g”);
5
item
(5) [“B”, “C”, “e”, “f”, “g”]
item.concat([“h”,”i”]);
(7) [“B”, “C”, “e”, “f”, “g”, “h”, “i”]
item
(5) [“B”, “C”, “e”, “f”, “g”]

Subscribe to My Channel Tech Guru Manjit

css Properties

IP Phone Configure

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here