diff --git a/Data_Structures/Arrays/Iterators/README.md b/Data_Structures/Arrays/Iterators/README.md index aabd365..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. +**Simple Iteration** +The way to iterate elements in javascript arrays is pretty straight forward: -(for Bucky to fill up) + console.log(food[2]); -# Course Documentation - -(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 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 d85b5ad..cf9b3e5 100644 --- a/Data_Structures/Arrays/New_ES6_Features_2/README.md +++ b/Data_Structures/Arrays/New_ES6_Features_2/README.md @@ -1,18 +1,19 @@ ![](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) - -## Element to explain - -(for example console.log) - ##Javascript functions According to W3schools: @@ -46,7 +47,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 Written with [StackEdit](https://stackedit.io/). \ No newline at end of file diff --git a/Data_Structures/Arrays/Searching/README.md b/Data_Structures/Arrays/Searching/README.md index 6af1f60..225e99c 100644 --- a/Data_Structures/Arrays/Searching/README.md +++ b/Data_Structures/Arrays/Searching/README.md @@ -46,7 +46,75 @@ 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