You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Data_Structures/Arrays/Iterators/README.md
+68-1Lines changed: 68 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,74 @@ Function **parameters** are the **names** listed in the function definition.
46
46
47
47
Function **arguments** are the real **values** received by the function when it is invoked.
48
48
49
-
Inside the function, the arguments behave as local variables.
49
+
Inside the function, the arguments behave as local variables.
50
+
51
+
## Arrays
52
+
53
+
Arrays are a special type of objects that are getting accessed through numbers from zero up to N-1. Arrays are easy to be recognized from their typical syntax:
54
+
55
+
Array_name[0] = the value of the first place
56
+
57
+
According [Wikipedia](https://en.wikipedia.org/wiki/Array_data_structure):
58
+
*"In computer science, an array data structure, or simply an array, is a data structure consisting of a collection of elements (values or variables), each identified by at least one array index or key. An array is stored so that the position of each element can be computed from its index tuple by a mathematical formula."*
59
+
60
+
Now in our example:
61
+
62
+
var food = ['bacon', 'corn', 'ham', 'sausage'];
63
+
64
+
We see the initiation through the typical aray syntax:
65
+
66
+
67
+
var arrayname = ['first_Element_of_the_Array', 'second_Element_of_the_Array', 'third_Element_of_the_Array', etc... ]
68
+
69
+
The most important thing that we need to know about arrays is that Arrays are start counting from 0 instead of 1, (starting counting from 0 is very typical behavior for computers because of the binary system of counting that computer are based of).
70
+
That means that for a N entries in an Array we ae counting the places from zero until the N-1th place.
71
+
For example to access the 5th element of an array we are typing:
72
+
73
+
arrayname[4]
74
+
75
+
In our example we used few statments that we should explain bit further:
76
+
77
+
**Push and Pop**
78
+
Push adds new item to the end of an array
79
+
80
+
food.push('tuna');
81
+
console.log(food);
82
+
83
+
while pop removes and item from the end of an array.
84
+
85
+
var lastItem = food.pop();
86
+
console.log(lastItem);
87
+
console.log(food);
88
+
For both Push and Pop please feel free to check bellow about stacks.
89
+
90
+
**Simple Iteration**
91
+
The way to iterate elements in javascript arrays is pretty straight forward:
92
+
93
+
console.log(food[2]);
94
+
95
+
Array values are retrieved by index (starting at 0 not 1).
96
+
97
+
Iteration through loop
98
+
The best way to iterate an array is mathematically through a loop, like the example bellow:
99
+
100
+
// you can iterate over an array to access each individual element
101
+
for(var i=0; i<food.length; i++){
102
+
console.log(i, food[i]);
103
+
}
104
+
105
+
The simplest type of data structure is a linear array, also called one-dimensional array. For more informations about Arrays please visit the links below:
106
+
[Array data structure (Wikipedia)](https://en.wikipedia.org/wiki/Array_data_structure)
Copy file name to clipboardExpand all lines: Data_Structures/Arrays/New_ES6_Features_1/README.md
+68-1Lines changed: 68 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,74 @@ Function **parameters** are the **names** listed in the function definition.
46
46
47
47
Function **arguments** are the real **values** received by the function when it is invoked.
48
48
49
-
Inside the function, the arguments behave as local variables.
49
+
Inside the function, the arguments behave as local variables.
50
+
51
+
## Arrays
52
+
53
+
Arrays are a special type of objects that are getting accessed through numbers from zero up to N-1. Arrays are easy to be recognized from their typical syntax:
54
+
55
+
Array_name[0] = the value of the first place
56
+
57
+
According [Wikipedia](https://en.wikipedia.org/wiki/Array_data_structure):
58
+
*"In computer science, an array data structure, or simply an array, is a data structure consisting of a collection of elements (values or variables), each identified by at least one array index or key. An array is stored so that the position of each element can be computed from its index tuple by a mathematical formula."*
59
+
60
+
Now in our example:
61
+
62
+
var food = ['bacon', 'corn', 'ham', 'sausage'];
63
+
64
+
We see the initiation through the typical aray syntax:
65
+
66
+
67
+
var arrayname = ['first_Element_of_the_Array', 'second_Element_of_the_Array', 'third_Element_of_the_Array', etc... ]
68
+
69
+
The most important thing that we need to know about arrays is that Arrays are start counting from 0 instead of 1, (starting counting from 0 is very typical behavior for computers because of the binary system of counting that computer are based of).
70
+
That means that for a N entries in an Array we ae counting the places from zero until the N-1th place.
71
+
For example to access the 5th element of an array we are typing:
72
+
73
+
arrayname[4]
74
+
75
+
In our example we used few statments that we should explain bit further:
76
+
77
+
**Push and Pop**
78
+
Push adds new item to the end of an array
79
+
80
+
food.push('tuna');
81
+
console.log(food);
82
+
83
+
while pop removes and item from the end of an array.
84
+
85
+
var lastItem = food.pop();
86
+
console.log(lastItem);
87
+
console.log(food);
88
+
For both Push and Pop please feel free to check bellow about stacks.
89
+
90
+
**Simple Iteration**
91
+
The way to iterate elements in javascript arrays is pretty straight forward:
92
+
93
+
console.log(food[2]);
94
+
95
+
Array values are retrieved by index (starting at 0 not 1).
96
+
97
+
Iteration through loop
98
+
The best way to iterate an array is mathematically through a loop, like the example bellow:
99
+
100
+
// you can iterate over an array to access each individual element
101
+
for(var i=0; i<food.length; i++){
102
+
console.log(i, food[i]);
103
+
}
104
+
105
+
The simplest type of data structure is a linear array, also called one-dimensional array. For more informations about Arrays please visit the links below:
106
+
[Array data structure (Wikipedia)](https://en.wikipedia.org/wiki/Array_data_structure)
Copy file name to clipboardExpand all lines: Data_Structures/Arrays/New_ES6_Features_2/README.md
+68-1Lines changed: 68 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,74 @@ Function **parameters** are the **names** listed in the function definition.
46
46
47
47
Function **arguments** are the real **values** received by the function when it is invoked.
48
48
49
-
Inside the function, the arguments behave as local variables.
49
+
Inside the function, the arguments behave as local variables.
50
+
51
+
## Arrays
52
+
53
+
Arrays are a special type of objects that are getting accessed through numbers from zero up to N-1. Arrays are easy to be recognized from their typical syntax:
54
+
55
+
Array_name[0] = the value of the first place
56
+
57
+
According [Wikipedia](https://en.wikipedia.org/wiki/Array_data_structure):
58
+
*"In computer science, an array data structure, or simply an array, is a data structure consisting of a collection of elements (values or variables), each identified by at least one array index or key. An array is stored so that the position of each element can be computed from its index tuple by a mathematical formula."*
59
+
60
+
Now in our example:
61
+
62
+
var food = ['bacon', 'corn', 'ham', 'sausage'];
63
+
64
+
We see the initiation through the typical aray syntax:
65
+
66
+
67
+
var arrayname = ['first_Element_of_the_Array', 'second_Element_of_the_Array', 'third_Element_of_the_Array', etc... ]
68
+
69
+
The most important thing that we need to know about arrays is that Arrays are start counting from 0 instead of 1, (starting counting from 0 is very typical behavior for computers because of the binary system of counting that computer are based of).
70
+
That means that for a N entries in an Array we ae counting the places from zero until the N-1th place.
71
+
For example to access the 5th element of an array we are typing:
72
+
73
+
arrayname[4]
74
+
75
+
In our example we used few statments that we should explain bit further:
76
+
77
+
**Push and Pop**
78
+
Push adds new item to the end of an array
79
+
80
+
food.push('tuna');
81
+
console.log(food);
82
+
83
+
while pop removes and item from the end of an array.
84
+
85
+
var lastItem = food.pop();
86
+
console.log(lastItem);
87
+
console.log(food);
88
+
For both Push and Pop please feel free to check bellow about stacks.
89
+
90
+
**Simple Iteration**
91
+
The way to iterate elements in javascript arrays is pretty straight forward:
92
+
93
+
console.log(food[2]);
94
+
95
+
Array values are retrieved by index (starting at 0 not 1).
96
+
97
+
Iteration through loop
98
+
The best way to iterate an array is mathematically through a loop, like the example bellow:
99
+
100
+
// you can iterate over an array to access each individual element
101
+
for(var i=0; i<food.length; i++){
102
+
console.log(i, food[i]);
103
+
}
104
+
105
+
The simplest type of data structure is a linear array, also called one-dimensional array. For more informations about Arrays please visit the links below:
106
+
[Array data structure (Wikipedia)](https://en.wikipedia.org/wiki/Array_data_structure)
Copy file name to clipboardExpand all lines: Data_Structures/Arrays/Searching/README.md
+69-1Lines changed: 69 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,75 @@ Function **parameters** are the **names** listed in the function definition.
46
46
47
47
Function **arguments** are the real **values** received by the function when it is invoked.
48
48
49
-
Inside the function, the arguments behave as local variables.
49
+
Inside the function, the arguments behave as local variables.
50
+
51
+
## Arrays
52
+
53
+
Arrays are a special type of objects that are getting accessed through numbers from zero up to N-1. Arrays are easy to be recognized from their typical syntax:
54
+
55
+
Array_name[0] = the value of the first place
56
+
57
+
According [Wikipedia](https://en.wikipedia.org/wiki/Array_data_structure):
58
+
*"In computer science, an array data structure, or simply an array, is a data structure consisting of a collection of elements (values or variables), each identified by at least one array index or key. An array is stored so that the position of each element can be computed from its index tuple by a mathematical formula."*
59
+
60
+
Now in our example:
61
+
62
+
var food = ['bacon', 'corn', 'ham', 'sausage'];
63
+
64
+
We see the initiation through the typical aray syntax:
65
+
66
+
67
+
var arrayname = ['first_Element_of_the_Array', 'second_Element_of_the_Array', 'third_Element_of_the_Array', etc... ]
68
+
69
+
The most important thing that we need to know about arrays is that Arrays are start counting from 0 instead of 1, (starting counting from 0 is very typical behavior for computers because of the binary system of counting that computer are based of).
70
+
That means that for a N entries in an Array we ae counting the places from zero until the N-1th place.
71
+
For example to access the 5th element of an array we are typing:
72
+
73
+
arrayname[4]
74
+
75
+
In our example we used few statments that we should explain bit further:
76
+
77
+
**Push and Pop**
78
+
Push adds new item to the end of an array
79
+
80
+
food.push('tuna');
81
+
console.log(food);
82
+
83
+
while pop removes and item from the end of an array.
84
+
85
+
var lastItem = food.pop();
86
+
console.log(lastItem);
87
+
console.log(food);
88
+
For both Push and Pop please feel free to check bellow about stacks.
89
+
90
+
**Simple Iteration**
91
+
The way to iterate elements in javascript arrays is pretty straight forward:
92
+
93
+
console.log(food[2]);
94
+
95
+
Array values are retrieved by index (starting at 0 not 1).
96
+
97
+
Iteration through loop
98
+
The best way to iterate an array is mathematically through a loop, like the example bellow:
99
+
100
+
// you can iterate over an array to access each individual element
101
+
for(var i=0; i<food.length; i++){
102
+
console.log(i, food[i]);
103
+
}
104
+
105
+
The simplest type of data structure is a linear array, also called one-dimensional array. For more informations about Arrays please visit the links below:
106
+
[Array data structure (Wikipedia)](https://en.wikipedia.org/wiki/Array_data_structure)
Copy file name to clipboardExpand all lines: Data_Structures/Arrays/Sorting/README.md
+68-1Lines changed: 68 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,74 @@ Function **parameters** are the **names** listed in the function definition.
46
46
47
47
Function **arguments** are the real **values** received by the function when it is invoked.
48
48
49
-
Inside the function, the arguments behave as local variables.
49
+
Inside the function, the arguments behave as local variables.
50
+
51
+
## Arrays
52
+
53
+
Arrays are a special type of objects that are getting accessed through numbers from zero up to N-1. Arrays are easy to be recognized from their typical syntax:
54
+
55
+
Array_name[0] = the value of the first place
56
+
57
+
According [Wikipedia](https://en.wikipedia.org/wiki/Array_data_structure):
58
+
*"In computer science, an array data structure, or simply an array, is a data structure consisting of a collection of elements (values or variables), each identified by at least one array index or key. An array is stored so that the position of each element can be computed from its index tuple by a mathematical formula."*
59
+
60
+
Now in our example:
61
+
62
+
var food = ['bacon', 'corn', 'ham', 'sausage'];
63
+
64
+
We see the initiation through the typical aray syntax:
65
+
66
+
67
+
var arrayname = ['first_Element_of_the_Array', 'second_Element_of_the_Array', 'third_Element_of_the_Array', etc... ]
68
+
69
+
The most important thing that we need to know about arrays is that Arrays are start counting from 0 instead of 1, (starting counting from 0 is very typical behavior for computers because of the binary system of counting that computer are based of).
70
+
That means that for a N entries in an Array we ae counting the places from zero until the N-1th place.
71
+
For example to access the 5th element of an array we are typing:
72
+
73
+
arrayname[4]
74
+
75
+
In our example we used few statments that we should explain bit further:
76
+
77
+
**Push and Pop**
78
+
Push adds new item to the end of an array
79
+
80
+
food.push('tuna');
81
+
console.log(food);
82
+
83
+
while pop removes and item from the end of an array.
84
+
85
+
var lastItem = food.pop();
86
+
console.log(lastItem);
87
+
console.log(food);
88
+
For both Push and Pop please feel free to check bellow about stacks.
89
+
90
+
**Simple Iteration**
91
+
The way to iterate elements in javascript arrays is pretty straight forward:
92
+
93
+
console.log(food[2]);
94
+
95
+
Array values are retrieved by index (starting at 0 not 1).
96
+
97
+
Iteration through loop
98
+
The best way to iterate an array is mathematically through a loop, like the example bellow:
99
+
100
+
// you can iterate over an array to access each individual element
101
+
for(var i=0; i<food.length; i++){
102
+
console.log(i, food[i]);
103
+
}
104
+
105
+
The simplest type of data structure is a linear array, also called one-dimensional array. For more informations about Arrays please visit the links below:
106
+
[Array data structure (Wikipedia)](https://en.wikipedia.org/wiki/Array_data_structure)
0 commit comments