Skip to content

Commit 7e2e647

Browse files
committedSep 7, 2017
merge second edition
2 parents 51eec82 + 10b24fd commit 7e2e647

File tree

107 files changed

+5426
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+5426
-0
lines changed
 

‎README.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Learning JavaScript Data Structures and Algorithms
2+
====================================
3+
4+
Source code of **Learning JavaScript Data Structures and Algorithms** book.
5+
6+
| 1st edition | 2nd edition |
7+
| ------------- |:-------------:|
8+
| ![1st edition](https://d1ldz4te4covpm.cloudfront.net/sites/default/files/imagecache/ppv4_main_book_cover/4874OS_Learning%20JavaScript%20Data%20Structures%20and%20Algorithms.jpg) | ![2nd edition](https://d255esdrn735hr.cloudfront.net/sites/default/files/imagecache/ppv4_main_book_cover/5493OS_5348_Learning%20JavaScript%20Data%20Structures%20and%20Algorithms,%20Second%20Edition.jpg) |
9+
| [Book link](http://amzn.to/1Y1OWPx)| [Book link](http://amzn.to/1TSkcA1)|
10+
11+
Book link - first edition:
12+
- [Packt](https://www.packtpub.com/application-development/learning-javascript-data-structures-and-algorithms)
13+
- [Amazon](http://amzn.to/1Y1OWPx)
14+
- [Chinese version](http://www.ituring.com.cn/book/1613)
15+
- [Korean version](http://www.acornpub.co.kr/book/javascript-data-structure)
16+
17+
Book link - second edition:
18+
- [Packt](https://www.packtpub.com/web-development/learning-javascript-data-structures-and-algorithms-second-edition)
19+
- [Amazon](http://amzn.to/1TSkcA1)
20+
- [Brazilian Portuguese version](https://novatec.com.br/livros/estruturas-de-dados-algoritmos-em-javascript/)
21+
22+
### List of Chapters:
23+
24+
* 01: [JavaScript: a quick overview](https://github.com/loiane/javascript-datastructures-algorithms/tree/second-edition/chapter01)
25+
* 02: [Arrays](https://github.com/loiane/javascript-datastructures-algorithms/tree/second-edition/chapter02)
26+
* 03: [Stacks](https://github.com/loiane/javascript-datastructures-algorithms/tree/second-edition/chapter03)
27+
* 04: [Queues](https://github.com/loiane/javascript-datastructures-algorithms/tree/second-edition/chapter04)
28+
* 05: [Linked Lists](https://github.com/loiane/javascript-datastructures-algorithms/tree/second-edition/chapter05)
29+
* 06: [Sets](https://github.com/loiane/javascript-datastructures-algorithms/tree/second-edition/chapter06)
30+
* 07: [Dictionaries and Hashes](https://github.com/loiane/javascript-datastructures-algorithms/tree/second-edition/chapter07)
31+
* 08: [Trees](https://github.com/loiane/javascript-datastructures-algorithms/tree/second-edition/chapter08)
32+
* 09: [Graphs](https://github.com/loiane/javascript-datastructures-algorithms/tree/second-edition/chapter09)
33+
* 10: [Sorting and searching algorithms](https://github.com/loiane/javascript-datastructures-algorithms/tree/second-edition/chapter10)
34+
* 11: [Pattern of algorithms](https://github.com/loiane/javascript-datastructures-algorithms/tree/second-edition/chapter11)
35+
* 12: [Algorithm Complexity](https://github.com/loiane/javascript-datastructures-algorithms/tree/second-edition/chapter12)
36+
37+
### First Edition source code:
38+
39+
Please refer to [this link](https://github.com/loiane/javascript-datastructures-algorithms/tree/master)
40+
41+
### Found an issue or have a question?
42+
43+
Please create an [Issue](https://github.com/loiane/javascript-datastructures-algorithms/issues) or [Pull Request](https://github.com/loiane/javascript-datastructures-algorithms/pulls)

‎chapter01/02-Variables.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
var num = 1; //{1}
2+
num = 3; //{2}
3+
4+
var price = 1.5; //{3}
5+
var name = 'Packt'; //{4}
6+
var trueValue = true; //{5}
7+
var nullVar = null; //{6}
8+
var und; //7
9+
10+
console.log("num: "+ num);
11+
console.log("name: "+ name);
12+
console.log("trueValue: "+ trueValue);
13+
console.log("price: "+ price);
14+
console.log("nullVar: "+ nullVar);
15+
console.log("und: "+ und);
16+
17+
//******* Variable Scope
18+
19+
var myVariable = 'global';
20+
myOtherVariable = 'global';
21+
22+
function myFunction(){
23+
var myVariable = 'local';
24+
return myVariable;
25+
}
26+
27+
function myOtherFunction(){
28+
myOtherVariable = 'local';
29+
return myOtherVariable;
30+
}
31+
32+
console.log(myVariable); //{1}
33+
console.log(myFunction()); //{2}
34+
35+
console.log(myOtherVariable); //{3}
36+
console.log(myOtherFunction()); //{4}
37+
console.log(myOtherVariable); //{5}

0 commit comments

Comments
 (0)