Skip to content

Commit 1278b01

Browse files
authored
Merge pull request buckyroberts#14 from Exarchiasghost/master
Bit of work to the Arrays folder.
2 parents 31f07cf + 1f99db8 commit 1278b01

File tree

5 files changed

+378
-33
lines changed

5 files changed

+378
-33
lines changed

Data_Structures/Arrays/Iterators/README.md

Lines changed: 82 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
![](http://i.imgur.com/BgUMUGU.png)
22

33
# 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:
56

6-
(for Bucky to fill up)
7+
console.log(food[2]);
78

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:
1113

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+
1320

14-
(for example console.log)
21+
# Course Documentation
1522

1623
##Javascript functions
1724

@@ -46,7 +53,74 @@ Function **parameters** are the **names** listed in the function definition.
4653

4754
Function **arguments** are the real **values** received by the function when it is invoked.
4855

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)
114+
[JavaScript Arrays (w3Schools)](http://www.w3schools.com/js/js_arrays.asp)
115+
## Stacks
116+
117+
A stack is a data structure that can be logically thought of as a real physical stack or pile, a structure where
118+
insertion and deletion of items takes place at one end only called the "top" of the stack. The basic concept can be
119+
illustrated by thinking of your data set as a stack of plates or books where you can only take the top item off the
120+
stack in order to remove things from it.
121+
122+
![](http://i.imgur.com/dax54C9.jpg)
123+
50124

51125
#The New Boston
52126
## Links

Data_Structures/Arrays/New_ES6_Features_1/README.md

Lines changed: 79 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
![](http://i.imgur.com/BgUMUGU.png)
22

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.
711

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+
814
# Course Documentation
915

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-
1616
##Javascript functions
1717

1818
According to W3schools:
@@ -46,7 +46,74 @@ Function **parameters** are the **names** listed in the function definition.
4646

4747
Function **arguments** are the real **values** received by the function when it is invoked.
4848

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)
107+
[JavaScript Arrays (w3Schools)](http://www.w3schools.com/js/js_arrays.asp)
108+
## Stacks
109+
110+
A stack is a data structure that can be logically thought of as a real physical stack or pile, a structure where
111+
insertion and deletion of items takes place at one end only called the "top" of the stack. The basic concept can be
112+
illustrated by thinking of your data set as a stack of plates or books where you can only take the top item off the
113+
stack in order to remove things from it.
114+
115+
![](http://i.imgur.com/dax54C9.jpg)
116+
50117

51118
#The New Boston
52119
## Links
@@ -56,5 +123,5 @@ Inside the function, the arguments behave as local variables.
56123
- [Facebook](https://www.facebook.com/TheNewBoston-464114846956315/)
57124
- [Twitter](https://twitter.com/bucky_roberts)
58125
- [Google+](https://plus.google.com/+BuckyRoberts)
59-
- [reddit](https://www.reddit.com/r/thenewboston/)
126+
- [reddit](https://www.reddit.com/r/thenewboston/)
60127
> Written with [StackEdit](https://stackedit.io/).

Data_Structures/Arrays/New_ES6_Features_2/README.md

Lines changed: 80 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
![](http://i.imgur.com/BgUMUGU.png)
22

33
# 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.
712

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+
815
# Course Documentation
916

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-
1617
##Javascript functions
1718

1819
According to W3schools:
@@ -46,7 +47,74 @@ Function **parameters** are the **names** listed in the function definition.
4647

4748
Function **arguments** are the real **values** received by the function when it is invoked.
4849

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)
108+
[JavaScript Arrays (w3Schools)](http://www.w3schools.com/js/js_arrays.asp)
109+
## Stacks
110+
111+
A stack is a data structure that can be logically thought of as a real physical stack or pile, a structure where
112+
insertion and deletion of items takes place at one end only called the "top" of the stack. The basic concept can be
113+
illustrated by thinking of your data set as a stack of plates or books where you can only take the top item off the
114+
stack in order to remove things from it.
115+
116+
![](http://i.imgur.com/dax54C9.jpg)
117+
50118

51119
#The New Boston
52120
## Links
@@ -56,5 +124,6 @@ Inside the function, the arguments behave as local variables.
56124
- [Facebook](https://www.facebook.com/TheNewBoston-464114846956315/)
57125
- [Twitter](https://twitter.com/bucky_roberts)
58126
- [Google+](https://plus.google.com/+BuckyRoberts)
59-
- [reddit](https://www.reddit.com/r/thenewboston/)
127+
- [reddit](https://www.reddit.com/r/thenewboston/)
128+
60129
> Written with [StackEdit](https://stackedit.io/).

0 commit comments

Comments
 (0)