> For the complete documentation index, see [llms.txt](https://cs4all-icm.gitbook.io/js-the-interactive-web/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cs4all-icm.gitbook.io/js-the-interactive-web/unit-2-intro-to-dom-manipulation-basics/u2la1-mini-project-javascript-essentials.md).

# U2LA1 Mini Project: JavaScript Essentials

### Teacher Notes

This vanilla javascript lab is located exclusively in the [`script.js`](https://github.com/nycdoe-cs4all/interactive-web/blob/main/unit-2-intro-to-dom-manipulation-basics/U2LAB1/U2LAB1-Starter/script.js) ([repl.it version](https://replit.com/@qrtnycs4all/U2LA1-Mini-Project-Starter-Code#index.html)) is a series of challenges for students to get familiar with javascript essential topics from variable arithmetics to functions with conditional statements. The extensions are included but not labeled at the bottom of the `script.js`. They require researching the Pythagorean theorem formula and researching recursive functions to be completed.

**Students should utilize the Starter Code (**[**repl.it**](https://replit.com/@qrtnycs4all/U2LA1-Mini-Project-Starter-Code) **|** [**github**](https://github.com/nycdoe-cs4all/interactive-web/tree/main/unit-2-intro-to-dom-manipulation-basics/U2LAB1/U2LAB1-Starter)**) for this project.**&#x20;

### Prompt

For this lab, put together what you know so far about javascript and try the challenges in the ). Use the resources below under [Extra Help](#extra-help) if you get stuck. When the time's up come back here for some reflection questions.

### Exemplar (teacher's view only)

Take a look at [this finished example](https://github.com/nycdoe-cs4all/interactive-web/tree/main/unit-2-intro-to-dom-manipulation-basics/U2LAB1/U2LAB1-Exemplar) for the answer key to the javascript challenges.

### Culturally Responsive Best Practice

In the previous unit, students learned to build and add style to websites that they were, unfortunately, unable to interact with. Consider starting this unit by having students look for websites that they **can** interact with. Have them identify what is happening in their own words and why they enjoy interacting with the website they found. In this way, students can find something they can relate to that will demonstrate how vanilla javascript can potentially add value to the websites they build in the near future.

### Extra Help?

Use the following resources to see examples of how to implement the methods, functions and other concepts in the `script.js`:

* `Math.floor()`, `Math.sqrt()`, and [other Math methods](https://www.w3schools.com/js/js_math.asp).
* [String methods](https://www.w3schools.com/js/js_string_methods.asp)
* Converting to [Arrow functions](https://www.w3schools.com/js/js_arrow_function.asp)
* [Template Literals](https://www.w3schools.com/js/js_string_templates.asp) (aka Formatted Strings)
* [Recursive Functions](https://www.javascripttutorial.net/javascript-recursive-function/) \[Super Challenge]

**Reflection Questions:**

* What was the most challenging part of the lab? What was the part you're most proud of?
* What was one point in the challenges you got stuck? What did you do to unstick?
* Why might what you've learned today be useful for making websites in the future?
