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
+82-8Lines changed: 82 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,24 @@
1
1

2
2
3
3
# Iterators
4
-
This MD file serves as example/template. It will be filled up soon.
4
+
**Simple Iteration**
5
+
The way to iterate elements in javascript arrays is pretty straight forward:
5
6
6
-
(for Bucky to fill up)
7
+
console.log(food[2]);
7
8
8
-
# Course Documentation
9
-
10
-
(this for me to fill up with every element that you use in lessons. syntax explaination and links for more)
9
+
Array values are retrieved by index (starting at 0 not 1).
10
+
11
+
**Iteration through loop**
12
+
The best way to iterate an array is mathematically through a loop, like the example bellow:
11
13
12
-
## Element to explain
14
+
// you can iterate over an array to access each individual element
15
+
for(var i=0; i<food.length; i++){
16
+
console.log(i, food[i]);
17
+
}
18
+
19
+
13
20
14
-
(for example console.log)
21
+
# Course Documentation
15
22
16
23
##Javascript functions
17
24
@@ -46,7 +53,74 @@ Function **parameters** are the **names** listed in the function definition.
46
53
47
54
Function **arguments** are the real **values** received by the function when it is invoked.
48
55
49
-
Inside the function, the arguments behave as local variables.
56
+
Inside the function, the arguments behave as local variables.
57
+
58
+
## Arrays
59
+
60
+
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:
61
+
62
+
Array_name[0] = the value of the first place
63
+
64
+
According [Wikipedia](https://en.wikipedia.org/wiki/Array_data_structure):
65
+
*"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."*
66
+
67
+
Now in our example:
68
+
69
+
var food = ['bacon', 'corn', 'ham', 'sausage'];
70
+
71
+
We see the initiation through the typical aray syntax:
72
+
73
+
74
+
var arrayname = ['first_Element_of_the_Array', 'second_Element_of_the_Array', 'third_Element_of_the_Array', etc... ]
75
+
76
+
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).
77
+
That means that for a N entries in an Array we ae counting the places from zero until the N-1th place.
78
+
For example to access the 5th element of an array we are typing:
79
+
80
+
arrayname[4]
81
+
82
+
In our example we used few statments that we should explain bit further:
83
+
84
+
**Push and Pop**
85
+
Push adds new item to the end of an array
86
+
87
+
food.push('tuna');
88
+
console.log(food);
89
+
90
+
while pop removes and item from the end of an array.
91
+
92
+
var lastItem = food.pop();
93
+
console.log(lastItem);
94
+
console.log(food);
95
+
For both Push and Pop please feel free to check bellow about stacks.
96
+
97
+
**Simple Iteration**
98
+
The way to iterate elements in javascript arrays is pretty straight forward:
99
+
100
+
console.log(food[2]);
101
+
102
+
Array values are retrieved by index (starting at 0 not 1).
103
+
104
+
Iteration through loop
105
+
The best way to iterate an array is mathematically through a loop, like the example bellow:
106
+
107
+
// you can iterate over an array to access each individual element
108
+
for(var i=0; i<food.length; i++){
109
+
console.log(i, food[i]);
110
+
}
111
+
112
+
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:
113
+
[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
+79-12Lines changed: 79 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,18 @@
1
1

2
2
3
-
# New ES6 features part 1
4
-
This MD file serves as example/template. It will be filled up soon.
5
-
6
-
(for Bucky to fill up)
3
+
# New ES6 features part 1
4
+
According to [Wikipedia](https://en.wikipedia.org/wiki/ECMAScript):
5
+
ECMAScript (or ES) is a trademarked scripting-language specification standardized by Ecma International in ECMA-262 and ISO/IEC 16262. It was based on JavaScript, which now tracks ECMAScript. It is commonly used for client-side scripting on the World Wide Web.
6
+
7
+
8
+
##6th Edition - ECMAScript 2015
9
+
According to [Wikipedia](https://en.wikipedia.org/wiki/ECMAScript#6th_Edition_-_ECMAScript_2015):
10
+
The 6th edition, officially known as ECMAScript 2015, was finalized in June 2015. This update adds significant new syntax for writing complex applications, including classes and modules, but defines them semantically in the same terms as ECMAScript 5 strict mode. Other new features include iterators and for/of loops, Python-style generators and generator expressions, arrow functions, binary data, typed arrays, collections (maps, sets and weak maps), promises, number and math enhancements, reflection, and proxies (metaprogramming for virtual objects and wrappers). The complete list is extensive.
7
11
12
+
Browser support for ES6 is still incomplete. However, ES6 code can be transpiled into ES5 code, which has more consistent support across browsers. Transpiling adds an extra step to your build process whereas polyfills allow you to add extra functionalities by including another javascript file.
13
+
8
14
# Course Documentation
9
15
10
-
(this for me to fill up with every element that you use in lessons. syntax explaination and links for more)
11
-
12
-
## Element to explain
13
-
14
-
(for example console.log)
15
-
16
16
##Javascript functions
17
17
18
18
According to W3schools:
@@ -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
+80-11Lines changed: 80 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,19 @@
1
1

2
2
3
3
# New ES6 features part 2
4
-
This MD file serves as example/template. It will be filled up soon.
5
-
6
-
(for Bucky to fill up)
4
+
5
+
According to [Wikipedia](https://en.wikipedia.org/wiki/ECMAScript):
6
+
ECMAScript (or ES) is a trademarked scripting-language specification standardized by Ecma International in ECMA-262 and ISO/IEC 16262. It was based on JavaScript, which now tracks ECMAScript. It is commonly used for client-side scripting on the World Wide Web.
7
+
8
+
9
+
##6th Edition - ECMAScript 2015
10
+
According to [Wikipedia](https://en.wikipedia.org/wiki/ECMAScript#6th_Edition_-_ECMAScript_2015):
11
+
The 6th edition, officially known as ECMAScript 2015, was finalized in June 2015. This update adds significant new syntax for writing complex applications, including classes and modules, but defines them semantically in the same terms as ECMAScript 5 strict mode. Other new features include iterators and for/of loops, Python-style generators and generator expressions, arrow functions, binary data, typed arrays, collections (maps, sets and weak maps), promises, number and math enhancements, reflection, and proxies (metaprogramming for virtual objects and wrappers). The complete list is extensive.
7
12
13
+
Browser support for ES6 is still incomplete. However, ES6 code can be transpiled into ES5 code, which has more consistent support across browsers. Transpiling adds an extra step to your build process whereas polyfills allow you to add extra functionalities by including another javascript file.
14
+
8
15
# Course Documentation
9
16
10
-
(this for me to fill up with every element that you use in lessons. syntax explaination and links for more)
11
-
12
-
## Element to explain
13
-
14
-
(for example console.log)
15
-
16
17
##Javascript functions
17
18
18
19
According to W3schools:
@@ -46,7 +47,74 @@ Function **parameters** are the **names** listed in the function definition.
46
47
47
48
Function **arguments** are the real **values** received by the function when it is invoked.
48
49
49
-
Inside the function, the arguments behave as local variables.
50
+
Inside the function, the arguments behave as local variables.
51
+
52
+
## Arrays
53
+
54
+
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:
55
+
56
+
Array_name[0] = the value of the first place
57
+
58
+
According [Wikipedia](https://en.wikipedia.org/wiki/Array_data_structure):
59
+
*"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."*
60
+
61
+
Now in our example:
62
+
63
+
var food = ['bacon', 'corn', 'ham', 'sausage'];
64
+
65
+
We see the initiation through the typical aray syntax:
66
+
67
+
68
+
var arrayname = ['first_Element_of_the_Array', 'second_Element_of_the_Array', 'third_Element_of_the_Array', etc... ]
69
+
70
+
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).
71
+
That means that for a N entries in an Array we ae counting the places from zero until the N-1th place.
72
+
For example to access the 5th element of an array we are typing:
73
+
74
+
arrayname[4]
75
+
76
+
In our example we used few statments that we should explain bit further:
77
+
78
+
**Push and Pop**
79
+
Push adds new item to the end of an array
80
+
81
+
food.push('tuna');
82
+
console.log(food);
83
+
84
+
while pop removes and item from the end of an array.
85
+
86
+
var lastItem = food.pop();
87
+
console.log(lastItem);
88
+
console.log(food);
89
+
For both Push and Pop please feel free to check bellow about stacks.
90
+
91
+
**Simple Iteration**
92
+
The way to iterate elements in javascript arrays is pretty straight forward:
93
+
94
+
console.log(food[2]);
95
+
96
+
Array values are retrieved by index (starting at 0 not 1).
97
+
98
+
Iteration through loop
99
+
The best way to iterate an array is mathematically through a loop, like the example bellow:
100
+
101
+
// you can iterate over an array to access each individual element
102
+
for(var i=0; i<food.length; i++){
103
+
console.log(i, food[i]);
104
+
}
105
+
106
+
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:
107
+
[Array data structure (Wikipedia)](https://en.wikipedia.org/wiki/Array_data_structure)
0 commit comments