From 7ab4bb87d93c13c088048009ff1d2d9095e06fd7 Mon Sep 17 00:00:00 2001 From: Exarchiasghost Date: Sun, 14 Aug 2016 13:06:35 +0200 Subject: [PATCH 1/5] Major changes in all README.md in Arrays folder. bunch of text which talks about Arrays and stacks. --- Data_Structures/Arrays/Iterators/README.md | 69 +++++++++++++++++- .../Arrays/New_ES6_Features_1/README.md | 69 +++++++++++++++++- .../Arrays/New_ES6_Features_2/README.md | 69 +++++++++++++++++- Data_Structures/Arrays/Searching/README.md | 70 ++++++++++++++++++- Data_Structures/Arrays/Sorting/README.md | 69 +++++++++++++++++- 5 files changed, 341 insertions(+), 5 deletions(-) diff --git a/Data_Structures/Arrays/Iterators/README.md b/Data_Structures/Arrays/Iterators/README.md index aabd365..39dbdfa 100644 --- a/Data_Structures/Arrays/Iterators/README.md +++ b/Data_Structures/Arrays/Iterators/README.md @@ -46,7 +46,74 @@ Function **parameters** are the **names** listed in the function definition. Function **arguments** are the real **values** received by the function when it is invoked. -Inside the function, the arguments behave as local variables. +Inside the function, the arguments behave as local variables. + +## Arrays + +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: + + Array_name[0] = the value of the first place + + According [Wikipedia](https://en.wikipedia.org/wiki/Array_data_structure): + *"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."* + +Now in our example: + + var food = ['bacon', 'corn', 'ham', 'sausage']; + +We see the initiation through the typical aray syntax: + + + var arrayname = ['first_Element_of_the_Array', 'second_Element_of_the_Array', 'third_Element_of_the_Array', etc... ] + +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). +That means that for a N entries in an Array we ae counting the places from zero until the N-1th place. +For example to access the 5th element of an array we are typing: + + arrayname[4] + +In our example we used few statments that we should explain bit further: + +**Push and Pop** +Push adds new item to the end of an array + + food.push('tuna'); + console.log(food); + +while pop removes and item from the end of an array. + + var lastItem = food.pop(); + console.log(lastItem); + console.log(food); +For both Push and Pop please feel free to check bellow about stacks. + +**Simple Iteration** +The way to iterate elements in javascript arrays is pretty straight forward: + + console.log(food[2]); + +Array values are retrieved by index (starting at 0 not 1). + +Iteration through loop +The best way to iterate an array is mathematically through a loop, like the example bellow: + + // you can iterate over an array to access each individual element + for(var i=0; i Date: Sun, 14 Aug 2016 13:19:13 +0200 Subject: [PATCH 2/5] Arrays Iterators README.md update. --- Data_Structures/Arrays/Iterators/README.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Data_Structures/Arrays/Iterators/README.md b/Data_Structures/Arrays/Iterators/README.md index 39dbdfa..7801463 100644 --- a/Data_Structures/Arrays/Iterators/README.md +++ b/Data_Structures/Arrays/Iterators/README.md @@ -1,17 +1,24 @@ ![](http://i.imgur.com/BgUMUGU.png) # Iterators -This MD file serves as example/template. It will be filled up soon. - -(for Bucky to fill up) +**Simple Iteration** +The way to iterate elements in javascript arrays is pretty straight forward: -# Course Documentation + console.log(food[2]); -(this for me to fill up with every element that you use in lessons. syntax explaination and links for more) +Array values are retrieved by index (starting at 0 not 1). + +**Iteration through loop** +The best way to iterate an array is mathematically through a loop, like the example bellow: -## Element to explain + // you can iterate over an array to access each individual element + for(var i=0; i Date: Sun, 14 Aug 2016 13:33:54 +0200 Subject: [PATCH 3/5] New ES6 features one README.md update. Just filling the blancks. nothing major here. --- .../Arrays/New_ES6_Features_1/README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Data_Structures/Arrays/New_ES6_Features_1/README.md b/Data_Structures/Arrays/New_ES6_Features_1/README.md index 80cb009..85ebe66 100644 --- a/Data_Structures/Arrays/New_ES6_Features_1/README.md +++ b/Data_Structures/Arrays/New_ES6_Features_1/README.md @@ -1,10 +1,16 @@ ![](http://i.imgur.com/BgUMUGU.png) -# New ES6 features part 1 -This MD file serves as example/template. It will be filled up soon. - -(for Bucky to fill up) +# New ES6 features part 1 +According to [Wikipedia](https://en.wikipedia.org/wiki/ECMAScript): +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. + + +##6th Edition - ECMAScript 2015 +According to [Wikipedia](https://en.wikipedia.org/wiki/ECMAScript#6th_Edition_-_ECMAScript_2015): +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. +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. + # Course Documentation (this for me to fill up with every element that you use in lessons. syntax explaination and links for more) From a3244a064a0c0d640309cfafd6a40fd79f98339c Mon Sep 17 00:00:00 2001 From: Exarchiasghost Date: Sun, 14 Aug 2016 13:36:17 +0200 Subject: [PATCH 4/5] New ES6 features part 2 README.md update. Just filling the blanks. Nothing major. --- Data_Structures/Arrays/New_ES6_Features_2/README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Data_Structures/Arrays/New_ES6_Features_2/README.md b/Data_Structures/Arrays/New_ES6_Features_2/README.md index 1024fc7..e40955e 100644 --- a/Data_Structures/Arrays/New_ES6_Features_2/README.md +++ b/Data_Structures/Arrays/New_ES6_Features_2/README.md @@ -1,10 +1,17 @@ ![](http://i.imgur.com/BgUMUGU.png) # New ES6 features part 2 -This MD file serves as example/template. It will be filled up soon. - -(for Bucky to fill up) + +According to [Wikipedia](https://en.wikipedia.org/wiki/ECMAScript): +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. + + +##6th Edition - ECMAScript 2015 +According to [Wikipedia](https://en.wikipedia.org/wiki/ECMAScript#6th_Edition_-_ECMAScript_2015): +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. +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. + # Course Documentation (this for me to fill up with every element that you use in lessons. syntax explaination and links for more) From 1f99db87c891b383cee8ed6d26ccb730dd38dd80 Mon Sep 17 00:00:00 2001 From: Exarchiasghost Date: Sun, 14 Aug 2016 13:39:38 +0200 Subject: [PATCH 5/5] Small edits. nothing major to see here. just something that i forgot to delete. --- Data_Structures/Arrays/New_ES6_Features_1/README.md | 8 +------- Data_Structures/Arrays/New_ES6_Features_2/README.md | 9 ++------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/Data_Structures/Arrays/New_ES6_Features_1/README.md b/Data_Structures/Arrays/New_ES6_Features_1/README.md index 85ebe66..9f54fc7 100644 --- a/Data_Structures/Arrays/New_ES6_Features_1/README.md +++ b/Data_Structures/Arrays/New_ES6_Features_1/README.md @@ -13,12 +13,6 @@ Browser support for ES6 is still incomplete. However, ES6 code can be transpiled # Course Documentation -(this for me to fill up with every element that you use in lessons. syntax explaination and links for more) - -## Element to explain - -(for example console.log) - ##Javascript functions According to W3schools: @@ -129,5 +123,5 @@ stack in order to remove things from it. - [Facebook](https://www.facebook.com/TheNewBoston-464114846956315/) - [Twitter](https://twitter.com/bucky_roberts) - [Google+](https://plus.google.com/+BuckyRoberts) -- [reddit](https://www.reddit.com/r/thenewboston/) +- [reddit](https://www.reddit.com/r/thenewboston/) > Written with [StackEdit](https://stackedit.io/). \ No newline at end of file diff --git a/Data_Structures/Arrays/New_ES6_Features_2/README.md b/Data_Structures/Arrays/New_ES6_Features_2/README.md index e40955e..cf9b3e5 100644 --- a/Data_Structures/Arrays/New_ES6_Features_2/README.md +++ b/Data_Structures/Arrays/New_ES6_Features_2/README.md @@ -14,12 +14,6 @@ Browser support for ES6 is still incomplete. However, ES6 code can be transpiled # Course Documentation -(this for me to fill up with every element that you use in lessons. syntax explaination and links for more) - -## Element to explain - -(for example console.log) - ##Javascript functions According to W3schools: @@ -130,5 +124,6 @@ stack in order to remove things from it. - [Facebook](https://www.facebook.com/TheNewBoston-464114846956315/) - [Twitter](https://twitter.com/bucky_roberts) - [Google+](https://plus.google.com/+BuckyRoberts) -- [reddit](https://www.reddit.com/r/thenewboston/) +- [reddit](https://www.reddit.com/r/thenewboston/) + > Written with [StackEdit](https://stackedit.io/). \ No newline at end of file