├── .gitignore ├── LICENSE ├── Lesson01 ├── Activity01 │ └── paste_into_console.js ├── Activity02 │ ├── create_elements.js │ ├── css │ │ ├── semantic.min.css │ │ ├── store_with_header.css │ │ └── themes │ │ │ └── default │ │ │ └── assets │ │ │ └── fonts │ │ │ ├── icons.woff │ │ │ └── icons.woff2 │ ├── data │ │ └── products.js │ ├── dynamic_storefront.html │ ├── filter_and_search.js │ ├── images │ │ ├── brick-wall-1245825_1920.jpg │ │ └── products │ │ │ ├── apples.jpg │ │ │ ├── avocado.jpg │ │ │ ├── blueberry_muffins.jpg │ │ │ ├── butter.jpg │ │ │ ├── cherries.jpg │ │ │ ├── chocolate_chips_cookies.png │ │ │ ├── christmas_cookies.jpg │ │ │ ├── croissant.jpg │ │ │ ├── dark_chocolate.jpg │ │ │ ├── eggs.jpg │ │ │ ├── grapes.jpg │ │ │ ├── milk_chocolate.jpg │ │ │ ├── nachos.jpg │ │ │ ├── parmesan.jpg │ │ │ ├── pear.jpg │ │ │ ├── petit_french_baguette.jpg │ │ │ ├── smiley_cookies.jpg │ │ │ ├── strawberries.jpg │ │ │ ├── swiss_cheese.jpg │ │ │ ├── white_chocolate.jpg │ │ │ └── whole_wheat_bread.jpg │ ├── search_box.js │ └── tags_holder.js ├── Example │ ├── css │ │ ├── semantic.min.css │ │ ├── store.css │ │ ├── store_with_header.css │ │ └── themes │ │ │ └── default │ │ │ └── assets │ │ │ └── fonts │ │ │ ├── icons.woff │ │ │ └── icons.woff2 │ ├── data │ │ ├── generate_data.js │ │ └── products.js │ ├── images │ │ ├── brick-wall-1245825_1920.jpg │ │ └── products │ │ │ ├── apples.jpg │ │ │ ├── avocado.jpg │ │ │ ├── blueberry_muffins.jpg │ │ │ ├── butter.jpg │ │ │ ├── cherries.jpg │ │ │ ├── chocolate_chips_cookies.png │ │ │ ├── christmas_cookies.jpg │ │ │ ├── croissant.jpg │ │ │ ├── dark_chocolate.jpg │ │ │ ├── eggs.jpg │ │ │ ├── grapes.jpg │ │ │ ├── milk_chocolate.jpg │ │ │ ├── nachos.jpg │ │ │ ├── parmesan.jpg │ │ │ ├── pear.jpg │ │ │ ├── petit_french_baguette.jpg │ │ │ ├── smiley_cookies.jpg │ │ │ ├── strawberries.jpg │ │ │ ├── swiss_cheese.jpg │ │ │ ├── white_chocolate.jpg │ │ │ └── whole_wheat_bread.jpg │ ├── sample_001 │ │ └── sample-page.html │ ├── sample_002 │ │ └── sample-store-front.html │ ├── sample_003 │ │ ├── create_elements.html │ │ └── create_elements.js │ ├── sample_counter │ │ ├── counter_component.css │ │ ├── counter_component.js │ │ └── web_components.html │ └── sample_shadow_dom │ │ └── shadow_dom.html ├── Exercise01 │ └── alert_paragraphs.html ├── Exercise04 │ ├── open_close_tree_print.js │ └── prettier_tree_print.js ├── Exercise05 │ ├── first_approach.js │ └── second_approach.js ├── Exercise06 │ ├── create_elements.js │ ├── css │ │ ├── semantic.min.css │ │ ├── store_with_header.css │ │ └── themes │ │ │ └── default │ │ │ └── assets │ │ │ └── fonts │ │ │ ├── icons.woff │ │ │ └── icons.woff2 │ ├── data │ │ └── products.js │ ├── dynamic_storefront.html │ ├── filter_and_search.js │ └── images │ │ ├── brick-wall-1245825_1920.jpg │ │ └── products │ │ ├── apples.jpg │ │ ├── avocado.jpg │ │ ├── blueberry_muffins.jpg │ │ ├── butter.jpg │ │ ├── cherries.jpg │ │ ├── chocolate_chips_cookies.png │ │ ├── christmas_cookies.jpg │ │ ├── croissant.jpg │ │ ├── dark_chocolate.jpg │ │ ├── eggs.jpg │ │ ├── grapes.jpg │ │ ├── milk_chocolate.jpg │ │ ├── nachos.jpg │ │ ├── parmesan.jpg │ │ ├── pear.jpg │ │ ├── petit_french_baguette.jpg │ │ ├── smiley_cookies.jpg │ │ ├── strawberries.jpg │ │ ├── swiss_cheese.jpg │ │ ├── white_chocolate.jpg │ │ └── whole_wheat_bread.jpg └── Exercise07 │ ├── create_elements.js │ ├── css │ ├── semantic.min.css │ ├── store_with_header.css │ └── themes │ │ └── default │ │ └── assets │ │ └── fonts │ │ ├── icons.woff │ │ └── icons.woff2 │ ├── data │ └── products.js │ ├── dynamic_storefront.html │ ├── filter_and_search.js │ ├── images │ ├── brick-wall-1245825_1920.jpg │ └── products │ │ ├── apples.jpg │ │ ├── avocado.jpg │ │ ├── blueberry_muffins.jpg │ │ ├── butter.jpg │ │ ├── cherries.jpg │ │ ├── chocolate_chips_cookies.png │ │ ├── christmas_cookies.jpg │ │ ├── croissant.jpg │ │ ├── dark_chocolate.jpg │ │ ├── eggs.jpg │ │ ├── grapes.jpg │ │ ├── milk_chocolate.jpg │ │ ├── nachos.jpg │ │ ├── parmesan.jpg │ │ ├── pear.jpg │ │ ├── petit_french_baguette.jpg │ │ ├── smiley_cookies.jpg │ │ ├── strawberries.jpg │ │ ├── swiss_cheese.jpg │ │ ├── white_chocolate.jpg │ │ └── whole_wheat_bread.jpg │ └── search_box.js ├── Lesson02 ├── Activity03 │ ├── index.js │ ├── package-lock.json │ └── package.json ├── Example │ ├── sample_event_loop │ │ └── event_loop_sample.js │ ├── sample_npm │ │ ├── index.js │ │ └── package.json │ └── sample_scripts │ │ ├── index.js │ │ └── package.json ├── Exercise08 │ └── event_loop.js ├── Exercise09 │ ├── .nvmrc │ └── url_explorer.js └── Exercise10 │ ├── index.js │ ├── package-lock.json │ └── package.json ├── Lesson03 ├── Activity04 │ ├── .gitignore │ ├── index.js │ ├── package-lock.json │ └── package.json ├── Example │ ├── sample_filesystem │ │ ├── .gitignore │ │ ├── copy_file.js │ │ ├── directories_and_files.js │ │ ├── file_status.js │ │ ├── list_dir.js │ │ ├── read_stream.js │ │ └── write_stream.js │ ├── sample_globals │ │ ├── argv.js │ │ ├── console.js │ │ ├── dir_and_filename.js │ │ ├── read_input.js │ │ ├── setInterval.js │ │ └── setTimeout.js │ ├── sample_http │ │ ├── http_client_get.js │ │ ├── http_client_get_with_headers.js │ │ ├── http_client_post.js │ │ └── http_server.js │ └── sample_scraping │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── print_all_paths.js │ │ └── print_all_texts.js ├── Exercise11 │ ├── index.js │ └── package.json ├── Exercise12 │ ├── index.js │ ├── package-lock.json │ └── package.json ├── Exercise13 │ ├── index.js │ ├── package-lock.json │ └── package.json ├── Exercise14 │ ├── html │ │ └── index.html │ ├── index.js │ ├── package-lock.json │ ├── package.json │ ├── products.json │ └── static │ │ ├── css │ │ ├── semantic.min.css │ │ ├── store.css │ │ └── themes │ │ │ └── default │ │ │ └── assets │ │ │ └── fonts │ │ │ ├── icons.woff │ │ │ └── icons.woff2 │ │ └── images │ │ ├── brick-wall-1245825_1920.jpg │ │ └── products │ │ ├── apples.jpg │ │ ├── avocado.jpg │ │ ├── blueberry_muffins.jpg │ │ ├── butter.jpg │ │ ├── cherries.jpg │ │ ├── chocolate_chips_cookies.png │ │ ├── christmas_cookies.jpg │ │ ├── croissant.jpg │ │ ├── dark_chocolate.jpg │ │ ├── eggs.jpg │ │ ├── grapes.jpg │ │ ├── milk_chocolate.jpg │ │ ├── nachos.jpg │ │ ├── parmesan.jpg │ │ ├── pear.jpg │ │ ├── petit_french_baguette.jpg │ │ ├── smiley_cookies.jpg │ │ ├── strawberries.jpg │ │ ├── swiss_cheese.jpg │ │ ├── white_chocolate.jpg │ │ └── whole_wheat_bread.jpg └── Exercise15 │ ├── index.js │ ├── package-lock.json │ └── package.json ├── Lesson04 ├── Activity05 │ ├── config.js │ ├── package-lock.json │ ├── package.json │ ├── routes │ │ ├── check-in.js │ │ └── lock.js │ └── server.js ├── Example │ ├── Example18b │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── routes │ │ │ ├── devices │ │ │ │ ├── light.js │ │ │ │ └── lightStructure.js │ │ │ └── index.js │ │ └── server.js │ ├── heater │ │ ├── README.md │ │ ├── config.js │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── routes │ │ │ ├── check-in.js │ │ │ ├── devices │ │ │ │ ├── heater.js │ │ │ │ ├── light.js │ │ │ │ └── lightStructure.js │ │ │ └── index.js │ │ └── server.js │ └── mongo_logger_middleware │ │ ├── README.md │ │ ├── config.js │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── routes │ │ ├── check-in.js │ │ ├── devices │ │ │ ├── light.js │ │ │ └── lightStructure.js │ │ └── index.js │ │ └── server.js ├── Exercise16 │ ├── package-lock.json │ ├── package.json │ └── server.js ├── Exercise17 │ ├── package-lock.json │ ├── package.json │ ├── routes │ │ └── index.js │ └── server.js ├── Exercise18 │ ├── package-lock.json │ ├── package.json │ ├── routes │ │ ├── devices │ │ │ └── light.js │ │ └── index.js │ └── server.js ├── Exercise19 │ ├── package-lock.json │ ├── package.json │ ├── routes │ │ ├── devices │ │ │ ├── light.js │ │ │ └── lightStructure.js │ │ └── index.js │ └── server.js ├── Exercise20 │ ├── package-lock.json │ ├── package.json │ ├── routes │ │ ├── devices │ │ │ ├── light.js │ │ │ └── lightStructure.js │ │ └── index.js │ └── server.js └── Exercise21 │ ├── config.js │ ├── package-lock.json │ ├── package.json │ ├── routes │ ├── check-in.js │ ├── devices │ │ ├── light.js │ │ └── lightStructure.js │ └── index.js │ └── server.js ├── Lesson05 ├── Activtiy06 │ ├── .babelrc │ ├── .gitignore │ ├── build │ │ ├── bundle.js │ │ ├── images │ │ │ ├── bulb_off.png │ │ │ └── bulb_on.png │ │ ├── index.html │ │ └── js │ │ │ ├── __extra__ │ │ │ └── changeColor.js │ │ │ ├── colorLight.js │ │ │ ├── flashingLight.js │ │ │ ├── light.js │ │ │ └── viewer.js │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── images │ │ │ ├── bulb_off.png │ │ │ └── bulb_on.png │ │ ├── index.html │ │ └── js │ │ │ ├── __extra__ │ │ │ └── changeColor.js │ │ │ ├── colorLight.js │ │ │ ├── flashingLight.js │ │ │ ├── light.js │ │ │ └── viewer.js │ └── webpack.config.js ├── Exercise22 │ ├── .gitignore │ ├── images │ │ ├── bulb_off.png │ │ └── bulb_on.png │ ├── index.html │ ├── js │ │ ├── __extra__ │ │ │ └── changeColor.js │ │ ├── light.js │ │ └── viewer.js │ ├── package-lock.json │ └── package.json ├── Exercise23 │ └── number.js ├── Exercise24 │ ├── .gitignore │ ├── images │ │ ├── bulb_off.png │ │ └── bulb_on.png │ ├── index.html │ ├── js │ │ ├── __extra__ │ │ │ └── changeColor.js │ │ ├── light.js │ │ └── viewer.js │ ├── package-lock.json │ └── package.json ├── Exercise25 │ ├── .gitignore │ ├── images │ │ ├── bulb_off.png │ │ └── bulb_on.png │ ├── index.html │ ├── js │ │ ├── __extra__ │ │ │ └── changeColor.js │ │ ├── light.js │ │ └── viewer.js │ ├── package-lock.json │ └── package.json ├── Exercise26 │ ├── .gitignore │ ├── images │ │ ├── bulb_off.png │ │ └── bulb_on.png │ ├── index.html │ ├── js │ │ ├── __extra__ │ │ │ └── changeColor.js │ │ ├── colorLight.js │ │ ├── light.js │ │ └── viewer.js │ ├── package-lock.json │ └── package.json ├── Exercise27 │ ├── .gitignore │ ├── images │ │ ├── bulb_off.png │ │ └── bulb_on.png │ ├── index.html │ ├── js │ │ ├── __extra__ │ │ │ └── changeColor.js │ │ ├── colorLight.js │ │ ├── light.js │ │ └── viewer.js │ ├── package-lock.json │ └── package.json ├── Exercise28 │ ├── .babelrc │ ├── .gitignore │ ├── build │ │ ├── bundle.js │ │ ├── images │ │ │ ├── bulb_off.png │ │ │ └── bulb_on.png │ │ ├── index.html │ │ └── js │ │ │ ├── __extra__ │ │ │ └── changeColor.js │ │ │ ├── colorLight.js │ │ │ ├── light.js │ │ │ └── viewer.js │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── images │ │ │ ├── bulb_off.png │ │ │ └── bulb_on.png │ │ ├── index.html │ │ └── js │ │ │ ├── __extra__ │ │ │ └── changeColor.js │ │ │ ├── colorLight.js │ │ │ ├── light.js │ │ │ └── viewer.js │ └── webpack.config.js └── start │ ├── .gitignore │ ├── images │ ├── bulb_off.png │ └── bulb_on.png │ ├── index.html │ ├── js │ └── viewer.js │ ├── package-lock.json │ └── package.json ├── Lesson06 ├── .gitignore ├── Activity07 │ ├── result │ │ ├── .eslintrc │ │ ├── .gitignore │ │ ├── .huskyrc │ │ ├── .prettierignore │ │ ├── __tests__ │ │ │ └── calc.test.js │ │ ├── css │ │ │ └── style.css │ │ ├── images │ │ │ └── screenshot.png │ │ ├── index.html │ │ ├── jest-puppeteer.config.js │ │ ├── js │ │ │ └── index.js │ │ ├── package-lock.json │ │ └── package.json │ └── start │ │ ├── .gitignore │ │ ├── css │ │ └── style.css │ │ ├── images │ │ └── screenshot.png │ │ ├── index.html │ │ ├── js │ │ └── index.js │ │ ├── package-lock.json │ │ └── package.json ├── Exercise29 │ ├── result │ │ ├── .eslintrc │ │ ├── .gitignore │ │ ├── .prettierignore │ │ ├── package-lock.json │ │ ├── package.json │ │ └── src │ │ │ └── square.js │ └── start │ │ └── .gitignore ├── Exercise30 │ ├── result │ │ ├── __test__ │ │ │ └── math.test.js │ │ ├── package-lock.json │ │ ├── package.json │ │ └── src │ │ │ └── math.js │ └── start │ │ └── src │ │ └── math.js ├── Exercise31 │ ├── result │ │ ├── __test__ │ │ │ └── math.test.js │ │ ├── package-lock.json │ │ ├── package.json │ │ └── src │ │ │ └── math.js │ └── start │ │ ├── package-lock.json │ │ ├── package.json │ │ └── src │ │ └── math.js ├── Exercise32 │ ├── result │ │ ├── __tests__ │ │ │ └── fib.test.js │ │ ├── fastFib.js │ │ ├── package.json │ │ ├── slowFib.js │ │ └── yarn.lock │ └── start │ │ ├── fastFib.js │ │ ├── package.json │ │ ├── slowFib.js │ │ └── yarn.lock ├── Exercise33 │ ├── .gitignore │ ├── result │ │ ├── .gitignore │ │ ├── __tests__ │ │ │ └── test.test.js │ │ ├── css │ │ │ └── style.css │ │ ├── images │ │ │ └── screenshot.png │ │ ├── index.html │ │ ├── jest-puppeteer.config.js │ │ ├── js │ │ │ └── index.js │ │ ├── package-lock.json │ │ └── package.json │ └── start │ │ ├── .gitignore │ │ ├── css │ │ └── style.css │ │ ├── images │ │ └── screenshot.png │ │ ├── index.html │ │ ├── js │ │ └── index.js │ │ ├── package-lock.json │ │ └── package.json ├── Exercise34 │ ├── result │ │ └── README.md │ └── start │ │ ├── .eslintrc │ │ ├── .gitignore │ │ ├── package-lock.json │ │ ├── package.json │ │ └── src │ │ └── js.js ├── Exercise35 │ ├── result │ │ ├── .eslintrc │ │ ├── .gitignore │ │ ├── .huskyrc │ │ ├── package-lock.json │ │ ├── package.json │ │ └── src │ │ │ └── js.js │ └── start │ │ ├── .eslintrc │ │ ├── .gitignore │ │ ├── package-lock.json │ │ ├── package.json │ │ └── src │ │ └── js.js └── Exercise36 │ ├── .gitignore │ ├── result │ ├── .gitignore │ ├── __test__ │ │ └── quiz.test.js │ ├── index.html │ ├── jest-puppeteer.config.js │ ├── js │ │ ├── main.js │ │ └── questions.js │ ├── package-lock.json │ └── package.json │ └── start │ ├── .gitignore │ ├── index.html │ ├── js │ ├── main.js │ └── questions.js │ └── package.json ├── Lesson07 ├── Activity08 │ └── Activity08.js ├── Activity09 │ └── Activity09.js ├── Activity10 │ ├── Activity10.js │ └── Activity10_Solution.js ├── Exercise37 │ └── Exercise37.js ├── Exercise38 │ └── Exercise38.js ├── Exercise39 │ └── Exercise39.js ├── Exercise40 │ └── Exercise40.js ├── Exercise41 │ └── Exercise41.js ├── Exercise42 │ └── Exercise42.js ├── Exercise43 │ └── Exercise43.js ├── Exercise44 │ └── Exercise44.js ├── Exercise45 │ └── Exercise45.js ├── Exercise46 │ └── Exercise46.js ├── Exercise47 │ └── Exercise47.js ├── Exercise48 │ └── Exercise48.js ├── Exercise49 │ └── Exercise49.js ├── Exercise50 │ └── Exercise50.js ├── Exercise51 │ └── Exercise51.js ├── Exercise52 │ └── Exercise52.js ├── Exercise53 │ └── Exercise53.js ├── Exercise54 │ └── Exercise54.js ├── Exercise55 │ └── Exercise55.js ├── Exercise56 │ └── Exercise56.js ├── Exercise57 │ └── Exercise57.js ├── Exercise58 │ └── Exercise58.js ├── Exercise59 │ └── Exercise59.js └── Exercise60 │ └── Exercise60.js ├── Lesson08 ├── Activity11 │ └── Activity11.js ├── Activity12 │ └── Activity12.js ├── Exercise61 │ └── Exercise61.js ├── Exercise62 │ └── Exercise62.js ├── Exercise63 │ └── Exercise63.js ├── Exercise64 │ └── Exercise64.js ├── Exercise65 │ └── Exercise65.js └── Exercise66 │ └── Exercise66.js ├── Lesson09 ├── Activity13 │ └── events.js ├── Activity14 │ └── filewatcher.js ├── Exercise67 │ └── Exercise67.js ├── Exercise68 │ └── Exercise68.js └── Exercise69 │ └── Exercise69.js ├── Lesson10 ├── .gitignore ├── Activity15 │ ├── activity-on-checkout-prop-start.html │ ├── activity-on-checkout-prop-start.js │ ├── activity-on-checkout-prop.html │ ├── activity-on-checkout-prop.js │ └── package.json ├── Activity16 │ ├── activity-items-selector-test-start.js │ ├── activity-items-selector-test.js │ └── package.json ├── Activity17 │ ├── activity-app-start.html │ ├── activity-app-start.js │ ├── activity-app.html │ ├── activity-app.js │ ├── activity-bff.js │ └── package.json ├── Examples │ ├── 01-first-class │ │ ├── .babelrc │ │ ├── example-1-functions-as-values.js │ │ ├── example-10-this-react-issues.html │ │ ├── example-10-this-react-issues.js │ │ ├── example-2-inversion-of-control.js │ │ ├── example-3-add-event-listener.js │ │ ├── example-4-fs-readdir-callback.js │ │ ├── example-5-fetch-then.js │ │ ├── example-6-fs-readdir-promise.js │ │ ├── example-7-array-first-class.js │ │ ├── example-8-parent-child-react.html │ │ ├── example-8-parent-child-react.js │ │ ├── example-9-child-parent-react.html │ │ ├── example-9-child-parent-react.js │ │ ├── example-render-prop.js │ │ ├── package.json │ │ └── test.js │ ├── 02-pure │ │ ├── example-1-double-test.js │ │ ├── example-redux-counter.js │ │ └── package.json │ ├── 03-higher-order │ │ ├── example-1-react-bind.html │ │ ├── example-1-react-bind.js │ │ ├── example-2-test-parameter-bind.js │ │ ├── example-3-function-prototype-bind-call.js │ │ ├── example-4-array-like-array.js │ │ ├── example-5-sum-curried.js │ │ ├── example-6-partial-sum.js │ │ ├── example-7-generic-curry.js │ │ ├── example-8-revealing-module.js │ │ ├── example-9-function-comp-react.html │ │ ├── example-9-function-comp-react.js │ │ └── package.json │ ├── 04-composition │ │ ├── example-1-sum-simple-compose.js │ │ ├── example-2-micro-hello.js │ │ ├── example-3-request-timer.js │ │ ├── example-4-api-key-auth.js │ │ ├── example-5-express-api-key-auth.js │ │ └── package.json │ └── 05-immutability-side-effects │ │ ├── example-1-redux-action-creator.js │ │ ├── example-2-immutable-map-filter-reduce.js │ │ ├── example-3-immutable-object-rest-spread.js │ │ ├── example-4-immutable-array-rest-spread.js │ │ ├── example-5-immutable-object-freeze.js │ │ ├── example-6-component-did-mount-request.html │ │ ├── example-6-component-did-mount-request.js │ │ ├── example-7-use-effect-request.html │ │ ├── example-7-use-effect-request.js │ │ ├── example-8-thunk-usage.js │ │ ├── example-9-redux-thunk-request.html │ │ ├── example-9-redux-thunk-request.js │ │ ├── package.json │ │ └── schema.graphql ├── Exercise70 │ ├── exercise-re-implement-array-methods-start.js │ ├── exercise-re-implement-array-methods.js │ └── package.json ├── Exercise71 │ ├── exercise-price-of-basket-start.js │ ├── exercise-price-of-basket.js │ └── package.json ├── Exercise72 │ ├── exercise-add-product-start.html │ ├── exercise-add-product-start.js │ ├── exercise-add-product.html │ ├── exercise-add-product.js │ └── package.json ├── Exercise73 │ ├── exercise-render-prop-start.html │ ├── exercise-render-prop-start.js │ ├── exercise-render-prop.html │ ├── exercise-render-prop.js │ └── package.json ├── Exercise74 │ ├── exercise-redux-dispatch-start.html │ ├── exercise-redux-dispatch-start.js │ ├── exercise-redux-dispatch.html │ ├── exercise-redux-dispatch.js │ └── package.json ├── Exercise75 │ ├── exercise-reducer-test-start.js │ ├── exercise-reducer-test.js │ └── package.json ├── Exercise76 │ ├── exercise-items-selector-start.html │ ├── exercise-items-selector-start.js │ ├── exercise-items-selector.html │ ├── exercise-items-selector.js │ └── package.json ├── Exercise77 │ ├── exercise-2-to-n-compose-start.js │ ├── exercise-2-to-n-compose.js │ └── package.json ├── Exercise78 │ ├── exercise-micro-compose-start.js │ ├── exercise-micro-compose.js │ └── package.json ├── Exercise79 │ ├── exercise-refactor-action-creators-start.html │ ├── exercise-refactor-action-creators-start.js │ ├── exercise-refactor-action-creators.html │ ├── exercise-refactor-action-creators.js │ └── package.json ├── Exercise80 │ ├── exercise-map-to-props-start.html │ ├── exercise-map-to-props-start.js │ ├── exercise-map-to-props.html │ ├── exercise-map-to-props.js │ └── package.json ├── Exercise81 │ ├── exercise-graphql-micro-start.js │ ├── exercise-graphql-micro.js │ └── package.json └── package.json └── README.md /Lesson01/Activity01/paste_into_console.js: -------------------------------------------------------------------------------- 1 | var csv = 'name,price,unit\n'; 2 | var elements = Array.from(document.getElementsByClassName('item')); 3 | elements.forEach((el) => { 4 | var priceAndUnitElement = el.getElementsByTagName('span')[0]; 5 | var priceAndUnit = priceAndUnitElement.textContent.split("/"); 6 | var price = priceAndUnit[0].trim(); 7 | var unit = priceAndUnit[1].trim(); 8 | 9 | var name = el.getElementsByTagName('a')[0].textContent; 10 | 11 | csv += `${name},${price},${unit}\n`; 12 | }); 13 | console.log(csv); 14 | -------------------------------------------------------------------------------- /Lesson01/Activity02/css/themes/default/assets/fonts/icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrainingByPackt/Professional-JavaScript/58c2f50e3764b8d1aae52fca6dd2a7313461cd68/Lesson01/Activity02/css/themes/default/assets/fonts/icons.woff -------------------------------------------------------------------------------- /Lesson01/Activity02/css/themes/default/assets/fonts/icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrainingByPackt/Professional-JavaScript/58c2f50e3764b8d1aae52fca6dd2a7313461cd68/Lesson01/Activity02/css/themes/default/assets/fonts/icons.woff2 -------------------------------------------------------------------------------- /Lesson01/Activity02/dynamic_storefront.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 |This is a paragraph.
7 |This is a paragraph inside a div.
9 |This is a normal paragraph.
13 | 14 |I'm in a Shadow DOM tree.
This is a paragraph.
7 |This is a paragraph inside a div.
9 |This is a paragraph.
10 |This is a paragraph inside a div.
12 |This is another paragraph.
'); 21 | 22 | $('p').each((index, p) => { 23 | console.log(`${index} - ${p.firstChild.data}`); 24 | }); 25 | 26 | console.log($.html()); 27 | -------------------------------------------------------------------------------- /Lesson02/Activity03/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Activity03", 3 | "version": "1.0.0", 4 | "description": "Solution for activity in lesson 2", 5 | "main": "index.js", 6 | "repository": { 7 | "type": "git", 8 | "url": "git+https://github.com/TrainingByPackt/Professional-JavaScript.git", 9 | "directory": "Lesson02/Activity03" 10 | }, 11 | "author": "", 12 | "license": "MIT", 13 | "dependencies": { 14 | "cheerio": "^1.0.0-rc.3" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Lesson02/Example/sample_event_loop/event_loop_sample.js: -------------------------------------------------------------------------------- 1 | console.log('First'); 2 | 3 | setTimeout(() => { 4 | console.log('Last'); 5 | }, 100); 6 | 7 | console.log('Second'); 8 | -------------------------------------------------------------------------------- /Lesson02/Example/sample_npm/index.js: -------------------------------------------------------------------------------- 1 | console.log("I'm an npm package running from sample_npm"); 2 | -------------------------------------------------------------------------------- /Lesson02/Example/sample_npm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sample_npm", 3 | "version": "1.0.0", 4 | "description": "Sample project for the Professional Javascript courseware.", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/TrainingByPackt/Professional-JavaScript.git" 12 | }, 13 | "author": "", 14 | "license": "MIT", 15 | "bugs": { 16 | "url": "https://github.com/TrainingByPackt/Professional-JavaScript/issues" 17 | }, 18 | "homepage": "https://github.com/TrainingByPackt/Professional-JavaScript#readme" 19 | } 20 | -------------------------------------------------------------------------------- /Lesson02/Example/sample_scripts/index.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const name = ('' + fs.readFileSync('name.txt')).trim(); 3 | console.log(`Hello ${name}!`); 4 | -------------------------------------------------------------------------------- /Lesson02/Example/sample_scripts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sample_scripts", 3 | "version": "1.0.0", 4 | "description": "Sample code to demonstrate npm scripts", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | 9 | "myscript": "echo 'Hello World!'", 10 | 11 | "preexec": "echo 'John Doe' > name.txt", 12 | "exec": "node index.js", 13 | "postexec": "rm -v name.txt", 14 | 15 | "prestart": "echo 'John Doe' > name.txt", 16 | "start": "node index.js", 17 | "poststart": "rm -v name.txt" 18 | }, 19 | "repository": { 20 | "type": "git", 21 | "url": "git+https://github.com/TrainingByPackt/Professional-JavaScript.git", 22 | "directory": "Lesson02/Example/sample_scripts" 23 | }, 24 | "author": "", 25 | "license": "MIT" 26 | } 27 | -------------------------------------------------------------------------------- /Lesson02/Exercise08/event_loop.js: -------------------------------------------------------------------------------- 1 | console.log('First'); 2 | 3 | const start = Date.now(); 4 | setTimeout(() => { 5 | console.log(`Last, after: ${Date.now() - start}ms`); 6 | }, 100); 7 | 8 | console.log('Second'); 9 | -------------------------------------------------------------------------------- /Lesson02/Exercise09/.nvmrc: -------------------------------------------------------------------------------- 1 | 12.7.0 2 | -------------------------------------------------------------------------------- /Lesson02/Exercise09/url_explorer.js: -------------------------------------------------------------------------------- 1 | const url = new URL('https://www.someserver.com/not/a/path?param1=value1¶m2=value2'); 2 | console.log(`URL is: ${url.href}`); 3 | console.log(`Hostname: ${url.hostname}`); 4 | console.log(`Path: ${url.pathname}`); 5 | 6 | console.log(`Query string is: ${url.search}`); 7 | console.log('Query parameters:') 8 | Array.from(url.searchParams.entries()) 9 | .forEach((entry) => console.log(`\t- ${entry[0]} = ${entry[1]}`)); 10 | -------------------------------------------------------------------------------- /Lesson02/Exercise10/index.js: -------------------------------------------------------------------------------- 1 | const program = require('commander'); 2 | 3 | program.version('0.1.0') 4 | .option('-b, --add-bootstrap', 'Add Bootstrap 4 to the page.') 5 | .option('-c, --add-container', 'Adds a div with container id in the body.') 6 | .option('-t, --title [title]', 'Add a title to the page.') 7 | .parse(process.argv); 8 | 9 | let html = ''; 10 | 11 | if (program.title) { 12 | html += `Hello {who}
; 6 | } 7 | 8 | const App = () => ( 9 | <> 10 |Hello micro!
Run this withnode example-2-micro-hello.js
';
5 | });
6 |
7 | server.listen(3000, () => {
8 | console.log('Listening on http://localhost:3000');
9 | });
10 |
--------------------------------------------------------------------------------
/Lesson10/Examples/04-composition/example-3-request-timer.js:
--------------------------------------------------------------------------------
1 | const micro = require('micro');
2 |
3 | const hello = () =>
4 | 'Hello micro!
Run this withnode example-3-request-timer.js
';
5 |
6 | const timer = fn => async (req, res) => {
7 | console.time('request');
8 | const value = await fn(req, res);
9 | console.timeEnd('request');
10 | return value;
11 | };
12 |
13 | const server = micro(timer(hello));
14 |
15 | server.listen(3000, () => {
16 | console.log('Listening on http://localhost:3000');
17 | });
18 |
--------------------------------------------------------------------------------
/Lesson10/Examples/04-composition/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "04-composition",
3 | "version": "1.0.0",
4 | "author": "Hugo Di Francesco",
5 | "license": "MIT",
6 | "dependencies": {
7 | "express": "^4.17.1",
8 | "micro": "^9.3.4"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Lesson10/Examples/05-immutability-side-effects/example-1-redux-action-creator.js:
--------------------------------------------------------------------------------
1 | const ADD_PRODUCT = 'ADD_PRODUCT';
2 |
3 | function addProduct(newProduct) {
4 | return {
5 | type: ADD_PRODUCT,
6 | newProduct
7 | };
8 | }
9 |
--------------------------------------------------------------------------------
/Lesson10/Examples/05-immutability-side-effects/example-2-immutable-map-filter-reduce.js:
--------------------------------------------------------------------------------
1 | // Node.js built-in
2 | const assert = require('assert').strict;
3 |
4 | const initial = [
5 | {
6 | count: 1,
7 | name: 'Shampoo'
8 | },
9 | {
10 | count: 2,
11 | name: 'Soap'
12 | }
13 | ];
14 |
15 | function checkNoMutation() {
16 | assert.deepStrictEqual(initial, [
17 | {
18 | count: 1,
19 | name: 'Shampoo'
20 | },
21 | {
22 | count: 2,
23 | name: 'Soap'
24 | }
25 | ]);
26 | }
27 |
28 | checkNoMutation();
29 |
30 | assert.deepStrictEqual(
31 | initial.map(item => item.name),
32 | ['Shampoo', 'Soap'],
33 | 'demo map'
34 | );
35 | checkNoMutation();
36 |
37 | assert(
38 | initial.map(item => item.count).reduce((acc, curr) => acc + curr) === 3,
39 | 'demo map reduce'
40 | );
41 | checkNoMutation();
42 |
43 | assert.deepStrictEqual(
44 | initial.filter(item => item.count > 1),
45 | [{count: 2, name: 'Soap'}],
46 | 'demo filter'
47 | );
48 | checkNoMutation();
49 |
--------------------------------------------------------------------------------
/Lesson10/Examples/05-immutability-side-effects/example-5-immutable-object-freeze.js:
--------------------------------------------------------------------------------
1 | // Node.js built-in
2 | const assert = require('assert').strict;
3 |
4 | const myProduct = Object.freeze({
5 | name: 'Special Sauce',
6 | price: 1999
7 | });
8 |
9 | console.assert(myProduct.name === 'Special Sauce', 'no change to properties');
10 | console.assert(myProduct.price === 1999, 'no change to properties');
11 |
12 | assert.throws(() => {
13 | 'use strict';
14 | myProduct.category = 'condiments';
15 | }, 'writing to an existing property is an error in strict mode');
16 |
17 | assert.doesNotThrow(() => {
18 | myProduct.category = 'condiments';
19 | }, 'writing to an existing property is fine in non strict mode');
20 |
21 | assert.throws(() => {
22 | 'use strict';
23 | myProduct.name = 'Super Special Sauce';
24 | }, 'writing a new property is an error in strict mode');
25 |
26 | assert.doesNotThrow(() => {
27 | myProduct.name = 'Super Special Sauce';
28 | }, 'writing a new property is fine in non strict mode');
29 |
--------------------------------------------------------------------------------
/Lesson10/Examples/05-immutability-side-effects/example-6-component-did-mount-request.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Lesson10/Examples/05-immutability-side-effects/example-6-component-did-mount-request.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 |
4 | class App extends React.Component {
5 | constructor() {
6 | super();
7 | this.state = {};
8 | }
9 |
10 | componentDidMount() {
11 | fetch('https://hello-world-micro.glitch.me')
12 | .then(response => {
13 | if (response.ok) {
14 | return response.text();
15 | }
16 | })
17 | .then(data => {
18 | this.setState({
19 | message: data
20 | });
21 | });
22 | }
23 |
24 | render() {
25 | return (
26 | Message: {this.state.message}
28 |Message: {message}
22 |