11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/demos/18. closures-usage-jquery-prototype/closures-usage-jquery-prototype.js:
--------------------------------------------------------------------------------
1 | // (function ($) {
2 | // var $root = $('#root');
3 |
4 | // console.log($root.html());
5 | // //Error! $ is not jQuery here (Prototype.js is loaded last)
6 | // }(jQuery));
7 |
8 | // (function ($) {
9 | var $root = $("root");
10 |
11 | console.log($root.innerHTML);
12 | // }(Prototype));
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/homework/README.md:
--------------------------------------------------------------------------------
1 | Functions and Function Expressions
2 | ==================================
3 |
4 | ### Task 1.
5 | * Write a function that sums an array of numbers:
6 | * Numbers must be always of type `Number`
7 | * Returns `null` if the array is empty
8 | * Throws Error if the parameter is not passed (undefined)
9 | * Throws if any of the elements is not convertible to `Number`
10 |
11 | ### Task 2.
12 | * Write a function that finds all the prime numbers in a range
13 | * It should return the prime numbers in an array
14 | * It must throw an Error if any of the range params is not convertible to `Number`
15 | * It must throw an Error if any of the range params is missing
16 |
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/homework/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-driven-hw-mocha",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "mocha -R spec tests"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "devDependencies": {
12 | "chai": "^3.5.0",
13 | "mocha": "^3.2.0"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/homework/tasks/task-1.js:
--------------------------------------------------------------------------------
1 | /* Task Description */
2 | /*
3 | Write a function that sums an array of numbers:
4 | numbers must be always of type Number
5 | returns `null` if the array is empty
6 | throws Error if the parameter is not passed (undefined)
7 | throws if any of the elements is not convertible to Number
8 |
9 | */
10 |
11 | function solve() {
12 | return function sum() {
13 | }
14 | }
15 |
16 | module.exports = solve;
17 |
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/homework/tasks/task-2.js:
--------------------------------------------------------------------------------
1 | /* Task description */
2 | /*
3 | Write a function that finds all the prime numbers in a range
4 | 1) it should return the prime numbers in an array
5 | 2) it must throw an Error if any on the range params is not convertible to `Number`
6 | 3) it must throw an Error if any of the range params is missing
7 | */
8 |
9 | function solve() {
10 | return function findPrimes() {
11 | }
12 | }
13 |
14 | module.exports = solve;
15 |
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/homework/tests/tests-task-1.js:
--------------------------------------------------------------------------------
1 | /* globals describe, it */
2 | var solve = require('../tasks/task-1')();
3 | var expect = require('chai').expect;
4 |
5 | describe('Tests for "Task 1"', function () {
6 | it('expect solve([1, 2, 3]) to be equal to 6', function () {
7 | expect(solve([1, 2, 3])).to.equal(6);
8 | });
9 |
10 | it('expect solve([]) to return null', function () {
11 | expect(solve([])).to.be.null;
12 | });
13 |
14 | it('expect solve() to throw Error', function () {
15 | function test() {
16 | solve();
17 | }
18 | expect(test).to.throw();
19 | });
20 |
21 | it('expect solve(["1", "2"]) to be equal to 3', function () {
22 | expect(solve(['1', '2'])).to.eql(3);
23 | });
24 |
25 | it('expect solve(["1", "John"]) to throw Error', function () {
26 | function test() {
27 | solve(['1', 'John']);
28 | }
29 | expect(test).to.throw();
30 | });
31 | });
32 |
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/homework/tests/tests-task-2.js:
--------------------------------------------------------------------------------
1 | /* globals describe, it */
2 |
3 |
4 | var solve = require('../tasks/task-2')();
5 |
6 | var expect = require('chai').expect;
7 | describe('Tests for "Task 2"', function () {
8 | it('expect solve(1, 5) to be equal to [2, 3, 5]', function () {
9 | expect(solve(1, 5)).to.eql([2, 3, 5]);
10 | });
11 |
12 | it('expect solve(0, 5) to be equal to [2, 3, 5]', function(){
13 | expect(solve(0, 5)).to.eql([2, 3, 5]);
14 | });
15 |
16 | it('expect solve("1", "5") to be equal to [2, 3, 5]', function () {
17 | expect(solve('1', '5')).to.eql([2, 3, 5]);
18 | });
19 |
20 | it('expect solve() to throw error', function () {
21 | function test() {
22 | solve();
23 | }
24 | expect(test).to.throw();
25 | });
26 |
27 | it('expect solve(1) to throw error', function () {
28 | function test() {
29 | solve(1);
30 | }
31 | expect(test).to.throw();
32 | });
33 |
34 | it('expect solve(258, 262) to be equal to [](empty array)', function () {
35 | expect(solve(258, 262)).to.be.empty;
36 | });
37 | });
38 |
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic00.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic00.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic01.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic02.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic03.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic04.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic05.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic06.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic06.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic07.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic07.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic08.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic08.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic09.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic09.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic11.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic12.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic13.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic14.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic15.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic16.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic17.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic17.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic18.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic18.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic19.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic19.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic20.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic21.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic21.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic22.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic22.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/imgs/pic23.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/01. Functions-and-Function-Expressions/imgs/pic23.png
--------------------------------------------------------------------------------
/Topics/01. Functions-and-Function-Expressions/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Course Introduction
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/Topics/02. Closures-and-Scope/demos/1. function-scope.js:
--------------------------------------------------------------------------------
1 | if (true) {
2 | //uncomment to create function scope
3 | //(function(){
4 | var result = 'From the if';
5 | //}());
6 | }
7 | console.log(result);
--------------------------------------------------------------------------------
/Topics/02. Closures-and-Scope/demos/1. scopes-global.js:
--------------------------------------------------------------------------------
1 | function stringRepeat(ch, times) {
2 | //global variable
3 | //'use strict' //solves this
4 | str = '';
5 | for (var i = 0; i < times; i += 1) {
6 | str += ch;
7 | }
8 | return str;
9 | }
10 |
11 | console.log(stringRepeat('-', 20));
12 | console.log(str);
--------------------------------------------------------------------------------
/Topics/02. Closures-and-Scope/demos/3. scope-chain.js:
--------------------------------------------------------------------------------
1 | function outer() {
2 | var x = 'OUTER';
3 |
4 | function inner() {
5 | var x = 'INNER';
6 | return x;
7 | }
8 | inner();
9 | return {
10 | x: x,
11 | f: inner
12 | };
13 | }
14 |
15 | console.log(outer().x);
16 | console.log(outer().f());
17 |
--------------------------------------------------------------------------------
/Topics/02. Closures-and-Scope/demos/4. block-scope-let.js:
--------------------------------------------------------------------------------
1 | if (false) {
2 | var x = 5;
3 | let y = 6;
4 | }
5 | console.log(x);
6 | //works only if run with Babel or Traceur
7 | console.log(y);
8 |
--------------------------------------------------------------------------------
/Topics/02. Closures-and-Scope/demos/5. closures.js:
--------------------------------------------------------------------------------
1 | function outer(x) {
2 | function middle(y) {
3 | function inner(z) {
4 | return x + ' ' + y + ' ' + z;
5 | }
6 | return inner;
7 | }
8 | return middle;
9 | }
10 |
11 |
12 | var system = outer(4);
13 | system = system(4);
14 | system = system(2);
15 | console.log('System ' + system);
16 |
17 | var names = outer('Peter');
18 | names = names('Georgiev');
19 | names = names('Petrov');
20 | console.log('Hi! I am ' + names);
--------------------------------------------------------------------------------
/Topics/02. Closures-and-Scope/demos/6. closures-usage.js:
--------------------------------------------------------------------------------
1 | var database = function () {
2 | var records,
3 | lastId,
4 | self;
5 |
6 | function findRecordById(id) {
7 | var i,
8 | record;
9 | if (!records) {
10 | return null;
11 | }
12 | for (i = 0; i < records.length; i += 1) {
13 | record = records[i];
14 | if (record.id === id) {
15 | return record;
16 | }
17 | }
18 | return null;
19 | }
20 |
21 | function saveRecord(record) {
22 | if (!lastId) {
23 | lastId = 0;
24 | }
25 | if (!records) {
26 | records = [];
27 | }
28 | record.id = ++lastId;
29 | records.push(record);
30 | return self;
31 | }
32 |
33 | function getAllRecords() {
34 | var clonedRecords,
35 | i;
36 | clonedRecords = [];
37 | clonedRecords[records.length - 1] = undefined;
38 | for (i = 0; i < records.length; i += 1) {
39 | clonedRecords[i] = records[i];
40 | }
41 | return clonedRecords;
42 | }
43 |
44 | self = {
45 | save: saveRecord,
46 | findById: findRecordById,
47 | getAll: getAllRecords
48 | };
49 |
50 | return self;
51 | }();
52 |
53 |
54 | database.save({
55 | name: 'Peter',
56 | age: 13
57 | }).save({
58 | name: 'Gosho',
59 | age: 17
60 | }).save(database);
61 |
62 | console.log(database.getAll());
63 | console.log(database.findById(3));
--------------------------------------------------------------------------------
/Topics/02. Closures-and-Scope/homework/README.md:
--------------------------------------------------------------------------------
1 | # Closures and Scopes
2 |
3 | ### Task 1.
4 |
5 | - Create a module for working with books
6 | - The module must provide the following functionalities:
7 | - **Add a new book to category**
8 | - Each book has unique title, author and ISBN
9 | - It must return the newly created book with assigned ID
10 | - If the category is missing, it must be automatically created
11 | - **List all books**
12 | - Return an array of books
13 | - Books are sorted by ID
14 | - This can be done by author, by category or all
15 | - They are provided by an options object {category: ...} or {author: ...}
16 | - **List all categories**
17 | - Return an array of categories
18 | - Categories are sorted by ID
19 | - **Each book/category has a unique identifier (ID) that is a number greater than 1**
20 | - When adding a book/category, the ID is generated automatically
21 | - **Add validation everywhere, where possible**
22 | - Book title and category name must be between 2 and 100 characters, including letters, digits and special characters ('!', ',', '.', etc)
23 | - Author is any non-empty string
24 | - Unique params are Book title and Book ISBN
25 | - Book ISBN is an unique code that contains either 10 or 13 digits
26 | - If something is not valid - throw Error
27 | - **You are given a solution template in the [tasks/task-1.js](./tasks/task-1.js) file**
28 |
--------------------------------------------------------------------------------
/Topics/02. Closures-and-Scope/homework/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-driven-hw-mocha",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "mocha -R spec tests"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "devDependencies": {
12 | "chai": "^3.5.0",
13 | "mocha": "^3.2.0"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Topics/02. Closures-and-Scope/homework/tasks/task-1.js:
--------------------------------------------------------------------------------
1 | /* Task Description */
2 | /*
3 | * Create a module for working with books
4 | * The module must provide the following functionalities:
5 | * Add a new book to category
6 | * Each book has unique title, author and ISBN
7 | * It must return the newly created book with assigned ID
8 | * If the category is missing, it must be automatically created
9 | * List all books
10 | * Books are sorted by ID
11 | * This can be done by author, by category or all
12 | * List all categories
13 | * Categories are sorted by ID
14 | * Each book/catagory has a unique identifier (ID) that is a number greater than or equal to 1
15 | * When adding a book/category, the ID is generated automatically
16 | * Add validation everywhere, where possible
17 | * Book title and category name must be between 2 and 100 characters, including letters, digits and special characters ('!', ',', '.', etc)
18 | * Author is any non-empty string
19 | * Unique params are Book title and Book ISBN
20 | * Book ISBN is an unique code that contains either 10 or 13 digits
21 | * If something is not valid - throw Error
22 | */
23 | function solve() {
24 | var library = (function () {
25 | var books = [];
26 | var categories = [];
27 | function listBooks() {
28 | return books;
29 | }
30 |
31 | function addBook(book) {
32 | book.ID = books.length + 1;
33 | books.push(book);
34 | return book;
35 | }
36 |
37 | function listCategories() {
38 | return categories;
39 | }
40 |
41 | return {
42 | books: {
43 | list: listBooks,
44 | add: addBook
45 | },
46 | categories: {
47 | list: listCategories
48 | }
49 | };
50 | } ());
51 | return library;
52 | }
53 | module.exports = solve;
54 |
--------------------------------------------------------------------------------
/Topics/02. Closures-and-Scope/imgs/closures.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/02. Closures-and-Scope/imgs/closures.png
--------------------------------------------------------------------------------
/Topics/02. Closures-and-Scope/imgs/pic01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/02. Closures-and-Scope/imgs/pic01.png
--------------------------------------------------------------------------------
/Topics/02. Closures-and-Scope/imgs/pic03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/02. Closures-and-Scope/imgs/pic03.png
--------------------------------------------------------------------------------
/Topics/02. Closures-and-Scope/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Closures and Scope
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/demos/1. module.js:
--------------------------------------------------------------------------------
1 | var controls = (function () {
2 | function formatResult(name, value) {
3 | return name + ' says the result is ' + value;
4 | }
5 |
6 | class Calculator {
7 | constructor(name) {
8 | this.name = name;
9 | this.result = 0;
10 | };
11 |
12 | add(x) {
13 | x = +x;
14 | this.result += x;
15 | return this;
16 | };
17 |
18 | subtract(x) {
19 | x = +x;
20 | this.result -= x;
21 | return this;
22 | };
23 |
24 | showResult() {
25 | console.log(formatResult(this.name, this.result));
26 | return this;
27 | };
28 | };
29 |
30 | return { getCalculator: (name) => new Calculator(name) };
31 | } ());
32 |
33 | var calc = controls.getCalculator('First');
34 | calc.add(7);
35 | calc.showResult();
36 | calc.subtract(2);
37 | calc.showResult();
38 |
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/demos/2. revealing-module.js:
--------------------------------------------------------------------------------
1 | var controls = (function () {
2 |
3 | //hidden function
4 | function formatResult() {
5 | return this.name + ' says the result is ' + this.result;
6 | }
7 |
8 | class Calculator {
9 | constructor(name) {
10 | this.name = name;
11 | this.result = 0;
12 | };
13 |
14 | add(x) {
15 | this.result += +x;
16 | return this;
17 | };
18 |
19 | subtract(x) {
20 | this.result -= +x;
21 | return this;
22 | };
23 |
24 | showResult() {
25 | console.log(formatResult.call(this));
26 | return this;
27 | };
28 | };
29 |
30 | var getCalculator = (name) => new Calculator(name);
31 |
32 | //return only a reference to the function
33 | return { getCalculator };
34 | } ());
35 |
36 | var calc = controls.getCalculator('First')
37 | .add(7).showResult().subtract(2).showResult();
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/demos/3. revealing-module.js:
--------------------------------------------------------------------------------
1 | var people = (function(){
2 | var people = ['Will', 'Steve'];
3 |
4 | _render();
5 |
6 | function _render() { // private function
7 | //console.clear();
8 | console.log(people);
9 | }
10 |
11 | function addPerson(name) {
12 | people.push(name);
13 | _render();
14 | }
15 |
16 | function deletePerson(i) {
17 | people.splice(i, 1);
18 | _render();
19 | }
20 |
21 | return {
22 | addPerson: addPerson,
23 | deletePerson: deletePerson
24 | };
25 | })();
26 |
27 | people.addPerson("Jake");
28 | people.deletePerson(0);
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/demos/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
9 |
10 |
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/homework/README.md:
--------------------------------------------------------------------------------
1 | # Modules and patterns
2 | ==================================
3 |
4 | ### Task 1.
5 | * Create a module for a `Telerik Academy course`
6 | * The course has a `title` and `presentations`
7 | * Each presentation also has a `title`
8 | * There is a homework for each presentation
9 | * There is a set of students listed for the course
10 | * Each student has `firstname`, `lastname` and an `ID`
11 | * IDs must be unique integer numbers which are at least 1
12 | * Each student can submit a homework for each presentation in the course
13 | * Create method `init()`
14 | * Accepts a `string` - course title
15 | * Accepts an `array of strings` - presentation titles
16 | * Throws if there is an invalid title
17 | * Titles do not start or end with spaces
18 | * Titles do not have consecutive spaces
19 | * Titles have at least one character
20 | * Throws if there are no presentations
21 | * Create method `addStudent()` which lists a student for the course
22 | * Accepts a string in the format `'Firstname Lastname'`
23 | * Throws if any of the names are not valid
24 | * Names start with an upper case letter
25 | * All other symbols in the name (if any) are lowercase letters
26 | * Generates a unique student ID and returns it
27 | * Create method `getAllStudents()` that returns an array of students in the format:
28 | * {firstname: 'string', lastname: 'string', id: StudentID}
29 | * Create method `submitHomework()`
30 | * Accepts `studentID` and `homeworkID`
31 | * homeworkID 1 is for the first presentation
32 | * homeworkID 2 is for the second one
33 | * ...
34 | * Throws if any of the IDs are invalid
35 | * Create method `pushExamResults()`
36 | * Accepts an array of items in the format `{StudentID: ..., score: ...}`
37 | * StudentIDs which are not listed get 0 points
38 | * Throw if there is an invalid StudentID
39 | * Throw if same StudentID is given more than once ( he tried to cheat (: )
40 | * Throw if Score is not a number
41 | * Create method `getTopStudents()` which returns an array of the top **10 performing students**
42 | * Array must be sorted from **best to worst**
43 | * If there are less than 10, return them all
44 | * The final score that is used to calculate the top performing students is done as follows:
45 | * 75% of the exam result
46 | * 25% the submitted homework (count of submitted homeworks / count of all homeworks) for the course
47 |
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/homework/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-driven-hw-mocha",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "mocha -R spec tests"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "devDependencies": {
12 | "chai": "^3.5.0",
13 | "mocha": "^3.2.0"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/homework/tasks/task-1.js:
--------------------------------------------------------------------------------
1 | /* Task Description */
2 | /*
3 | * Create a module for a Telerik Academy course
4 | * The course has a title and presentations
5 | * Each presentation also has a title
6 | * There is a homework for each presentation
7 | * There is a set of students listed for the course
8 | * Each student has firstname, lastname and an ID
9 | * IDs must be unique integer numbers which are at least 1
10 | * Each student can submit a homework for each presentation in the course
11 | * Create method init
12 | * Accepts a string - course title
13 | * Accepts an array of strings - presentation titles
14 | * Throws if there is an invalid title
15 | * Titles do not start or end with spaces
16 | * Titles do not have consecutive spaces
17 | * Titles have at least one character
18 | * Throws if there are no presentations
19 | * Create method addStudent which lists a student for the course
20 | * Accepts a string in the format 'Firstname Lastname'
21 | * Throws if any of the names are not valid
22 | * Names start with an upper case letter
23 | * All other symbols in the name (if any) are lowercase letters
24 | * Generates a unique student ID and returns it
25 | * Create method getAllStudents that returns an array of students in the format:
26 | * {firstname: 'string', lastname: 'string', id: StudentID}
27 | * Create method submitHomework
28 | * Accepts studentID and homeworkID
29 | * homeworkID 1 is for the first presentation
30 | * homeworkID 2 is for the second one
31 | * ...
32 | * Throws if any of the IDs are invalid
33 | * Create method pushExamResults
34 | * Accepts an array of items in the format {StudentID: ..., Score: ...}
35 | * StudentIDs which are not listed get 0 points
36 | * Throw if there is an invalid StudentID
37 | * Throw if same StudentID is given more than once ( he tried to cheat (: )
38 | * Throw if Score is not a number
39 | * Create method getTopStudents which returns an array of the top 10 performing students
40 | * Array must be sorted from best to worst
41 | * If there are less than 10, return them all
42 | * The final score that is used to calculate the top performing students is done as follows:
43 | * 75% of the exam result
44 | * 25% the submitted homework (count of submitted homeworks / count of all homeworks) for the course
45 | */
46 |
47 | function solve() {
48 | var Course = {
49 | init: function(title, presentations) {
50 | },
51 | addStudent: function(name) {
52 | },
53 | getAllStudents: function() {
54 | },
55 | submitHomework: function(studentID, homeworkID) {
56 | },
57 | pushExamResults: function(results) {
58 | },
59 | getTopStudents: function() {
60 | }
61 | };
62 |
63 | return Course;
64 | }
65 |
66 |
67 | module.exports = solve;
68 |
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/imgs/pic00.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/03. Modules-and-Patterns/imgs/pic00.png
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/imgs/pic01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/03. Modules-and-Patterns/imgs/pic01.png
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/imgs/pic02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/03. Modules-and-Patterns/imgs/pic02.png
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/imgs/pic03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/03. Modules-and-Patterns/imgs/pic03.png
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/imgs/pic04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/03. Modules-and-Patterns/imgs/pic04.png
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/imgs/pic05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/03. Modules-and-Patterns/imgs/pic05.png
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/imgs/pic06.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/03. Modules-and-Patterns/imgs/pic06.png
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/imgs/pic07.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/03. Modules-and-Patterns/imgs/pic07.png
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/imgs/pic08.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/03. Modules-and-Patterns/imgs/pic08.png
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/imgs/pic09.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/03. Modules-and-Patterns/imgs/pic09.png
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/imgs/pic10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/03. Modules-and-Patterns/imgs/pic10.png
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/imgs/pic11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/03. Modules-and-Patterns/imgs/pic11.png
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/imgs/pic12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/03. Modules-and-Patterns/imgs/pic12.png
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/imgs/pic13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/03. Modules-and-Patterns/imgs/pic13.png
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/imgs/pic14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/03. Modules-and-Patterns/imgs/pic14.png
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/imgs/pic15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/03. Modules-and-Patterns/imgs/pic15.png
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/imgs/pic16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/03. Modules-and-Patterns/imgs/pic16.png
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/imgs/pic17.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/03. Modules-and-Patterns/imgs/pic17.png
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/imgs/pic18.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/03. Modules-and-Patterns/imgs/pic18.png
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/imgs/pic19.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/03. Modules-and-Patterns/imgs/pic19.png
--------------------------------------------------------------------------------
/Topics/03. Modules-and-Patterns/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Modules and Patterns
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
26 |
27 |
28 |
29 |
8 | https://telerikacademy.com
9 |
10 |
11 |
12 |
13 |
14 |
15 | # Table of Contents
16 | - [What is a class?](#classes)
17 | - [What are ES6 classes?](#es6-classes)
18 | - Creating and using ES6 classes
19 | - [Constructors](#constructors)
20 |
21 |
22 |
23 | # Classes
24 | ## What is a class?
25 |
26 |
27 |
28 | - Classes in general are used as **blueprints or templates for creation of objects**. Classes gives us a way to:
29 | - Create objects that have similar properties and behaviour
30 | - Reuse code and functionality between different object via **inheritance**
31 | - Hide implementation details and expose only what is needed - **encapsulation** and **abstraction**
32 | - Treat objects that have similar behaviour, but different concrete types, the same - **polymorphism**
33 |
34 |
35 | # ES6 Classes
36 | - ES6 introduces the `class` keyword
37 | - Classes in JavaScript are actually functions
38 |
39 | ```js
40 | class Superhero {
41 |
42 | }
43 |
44 | console.log(typeof Superhero); // logs 'function'
45 | ```
46 |
47 |
48 |
49 |
50 | - Lets create a class that has some data and use the class to create an object of that type:
51 | - an object of a class is created by calling the **class name** as a function with the `new` operator.
52 |
53 | ```js
54 | class Horse {
55 | constructor(name, furColor, age) {
56 | this._name = name;
57 | this._furColor = furColor;
58 | this._age = age;
59 | }
60 | }
61 |
62 | const horse = new Horse('Trendafil', 'brown', 2);
63 | console.log(horse);
64 | // { _name: 'Trendafil', _furColor: 'brown', age: 2 }
65 | ```
66 |
67 |
68 | # The `new` keyword
69 | - What happens when a function is called with the `new` keyword?
70 |
71 | ```js
72 | function F() {
73 | console.log(this);
74 | this.prop = 'hello';
75 | };
76 |
77 | const f = new F();
78 | console.log(f); // { prop: 'hello' }
79 | ```
80 |
81 |
82 |
83 | - The `new` keyword sets the **context** of the function to a new object
84 | - The result of the function execution will be the new object
85 |
86 |
87 | # The `class constructor`
88 | - The `class constructor` is a kind-of-function that is called with `new` and is executed when an object of a class is created
89 | - In the following example the **class constructor** will be called with its context set to a new object `{}`
90 |
91 | ```js
92 | class Horse {
93 | constructor(name, furColor, age) {
94 | this._name = name;
95 | this._furColor = furColor;
96 | this._age = age;
97 | }
98 | }
99 |
100 | const horse = new Horse('Trendafil', 'brown', 2);
101 | ```
102 |
103 |
104 |
105 | - **Class constructors** are obligatory and can be omitted. The following two snippets are equivalent:
106 |
107 | ```js
108 | class Superhero { }
109 |
110 | const gosho = new Superhero();
111 | ```
112 |
113 | ```js
114 | class Superhero {
115 | constructor() { }
116 | }
117 |
118 | const gosho = new Superhero();
119 | ```
120 |
121 |
122 |
123 |
124 |
125 |
127 |
128 |
129 | # Free Trainings @ Telerik Academy
130 | - "Web Design with HTML 5, CSS 3 and JavaScript" course @ Telerik Academy
131 | - [javascript course](http://academy.telerik.com/student-courses/web-design-and-ui/javascript-fundamentals/about)
132 | - Telerik Software Academy
133 | - [telerikacademy.com](https://telerikacademy.com)
134 | - Telerik Academy @ Facebook
135 | - [facebook.com/TelerikAcademy](https://facebook.com/TelerikAcademy)
136 | - Telerik Software Academy Forums
137 | - [forums.academy.telerik.com](https://telerikacademy.com/Forum/Home)
138 |
139 |
140 |
--------------------------------------------------------------------------------
/Topics/04. Classes-and-Class-Constructors/demos/demo.js:
--------------------------------------------------------------------------------
1 | console.log('04. Classes-and-Class-Constructors');
--------------------------------------------------------------------------------
/Topics/04. Classes-and-Class-Constructors/homework/README.md:
--------------------------------------------------------------------------------
1 | # 04. Classes-and-Class-Constructors Homeworks
2 |
--------------------------------------------------------------------------------
/Topics/04. Classes-and-Class-Constructors/imgs/es6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TelerikAcademy/JavaScript-OOP/759390f2476ff639e41be6d585ae3c458d41efb3/Topics/04. Classes-and-Class-Constructors/imgs/es6.png
--------------------------------------------------------------------------------
/Topics/04. Classes-and-Class-Constructors/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Classes and Class Constructors
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/Topics/05. Class-Methods-and-Properties/demos/demo.js:
--------------------------------------------------------------------------------
1 | console.log('05. Class-Methods-and-Properties');
2 |
--------------------------------------------------------------------------------
/Topics/05. Class-Methods-and-Properties/homework/README.md:
--------------------------------------------------------------------------------
1 | # 05. Class-Methods-and-Properties Homeworks
2 | - [Task 1 - Linked List](./task-1)
--------------------------------------------------------------------------------
/Topics/05. Class-Methods-and-Properties/homework/task-1/README.md:
--------------------------------------------------------------------------------
1 | # Linked list
2 | - Implement a **linked list** using **ES6 classes**. Use two classes - `LinkedList` and `listNode`. Look at the hints at the bottom of the description. Your class implementation should:
3 |
4 | ### Getters
5 | - have a getter `first` - return the value of the first node in the list
6 | - have a getter `last` - return the value of the last node in the list
7 | - have a getter `length` for the length of the linked list
8 |
9 | ### Methods
10 | - provide a method `append(el1, el2, el3...)` that adds the provided elements to the end of the list
11 | - should enable chaining
12 |
13 | ```js
14 | const list = new LinkedList();
15 | list.append(1, 2, 3).append(4);
16 | // list should contain 1, 2, 3 and 4
17 | ```
18 |
19 | - provide a method `prepend(el1, el2, el3...)` that adds the provided elements to the beggining of the list
20 | - should enable chaining
21 |
22 | ```js
23 | const list = new LinkedList();
24 | list.append(4, 5, 6).prepend(1, 2, 3);
25 | // should contain 1, 2, 3, 4, 5, 6 in that order
26 | ```
27 |
28 | - provide a method `insert(index, el1, el2, el3...)` for inserting values at the specified index
29 | - should enable chaining
30 |
31 | ```js
32 | const list = new LinkedList();
33 | list.append(1, 4, 5).insert(1, 2, 3);
34 | // list should contain 1, 2, 3, 4, 5
35 | ```
36 |
37 | - provide a method `at(index[, value])` for indexing
38 | - when passed an **index**, it should return the element at that **index**
39 | - when passed an **index** and a **value**, should change the value of the element at that index
40 |
41 | ```js
42 | const list = new LinkedList();
43 | list.append(1, 2, 3, 4, 5, 6);
44 | console.log(list.at(2)); // 3
45 |
46 | list.at(2, 'gosho');
47 | console.log(list.at(2)); // gosho
48 | ```
49 |
50 | - provide a method `removeAt(index)` that removes an element at a given index
51 | - should return the removed element
52 |
53 | ```js
54 | const list = new LinkedList();
55 |
56 | const removed = list.append(1, 2, 3, 4, 5).removeAt(1);
57 | // removed should be 2
58 | // the list should contain 1, 3, 4, 5
59 | ```
60 |
61 | - your class should be **iterable with a for-of loop**
62 | - you must use `Symbol.iterator`
63 |
64 | ```js
65 | class LinkedList {
66 | /*
67 | other code here
68 | */
69 |
70 | * [Symbol.iterator] {
71 | // iterator code
72 | }
73 | }
74 |
75 | const list = new LinkedList().append(6, 7, 8).prepend(1, 2, 3, 4, 5);
76 |
77 | for(const value of list) {
78 | console.log(value);
79 | }
80 | // output should be the numbers [1..8], each on a separate line
81 | ```
82 |
83 | - provide a `toArray()` method, that converts the linked list to an array
84 |
85 | ```js
86 | const list = new LinkedList();
87 | list.append(1, 2, 3, 4, 5, 6);
88 |
89 | const arr = list.toArray();
90 | console.log(arr); // [1, 2, 3, 4, 5, 6]
91 | console.log(arr instanceof Array); // true
92 | ```
93 |
94 | - provide method `toString()`, which should return a string representation of the linked list - the values of the elements, separated by **' -> '**
95 |
96 | ```js
97 | const list = new LinkedList();
98 | list.append(1, 2, 3, 4, 5, 6);
99 |
100 | console.log(list.toString()); // 1 -> 2 -> 3 -> 4 -> 5 -> 6
101 | ```
102 |
103 | #### Hints
104 | - Read about the linked list data structure on the internet.
105 | - You can watch [this video](https://youtu.be/WmwuLvxqmac?t=394).
106 | - You can try reading [this article](https://www.nczonline.net/blog/2009/04/13/computer-science-in-javascript-linked-list/).
107 | - Research on your own :)
108 | - Read about chaining in programming and fluent interfaces.
109 | - The **[spread operator](https://rainsoft.io/how-three-dots-changed-javascript/)**(`...`) might help you a bit with arguments.
110 | - Implementing **for-of** [iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators) first will help you with implementing `toArray` and `toString`.
111 | - Research ES2016 generator functions.
112 | - Research how to make an object iterable.
113 | - Try to reuse already implemented functionalities. Implemented iteration can be used for `toArray`. `toArray` can be used for `toString`. You can also reuse code between `append`, `prepend` and `insert`.
114 |
115 | #### Running the tests locally
116 | - Run `npm install` in this directory to download the dependencies in `package.json` (mocha and chai).
117 | - Run `npm test` to run the tests.
118 |
--------------------------------------------------------------------------------
/Topics/05. Class-Methods-and-Properties/homework/task-1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "task",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "task-1.js",
6 | "directories": {
7 | "test": "tests"
8 | },
9 | "scripts": {
10 | "test": "mocha -R spec tests"
11 | },
12 | "author": "",
13 | "license": "ISC",
14 | "dependencies": {
15 | "chai": "^3.5.0",
16 | "mocha": "^3.0.2"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Topics/05. Class-Methods-and-Properties/homework/task-1/task/task-1.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | class listNode {
4 | constructor(value) {
5 |
6 | }
7 | }
8 |
9 | class LinkedList {
10 | constructor() {
11 |
12 | }
13 | }
14 |
15 | module.exports = LinkedList;
--------------------------------------------------------------------------------
/Topics/05. Class-Methods-and-Properties/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Class Methods and Properties
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
26 |
27 |
28 |
29 |