diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ec20a06fff670d37befbd9.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ec20a06fff670d37befbd9.md index ff7d539018e..b5b56cee735 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ec20a06fff670d37befbd9.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ec20a06fff670d37befbd9.md @@ -1,52 +1,52 @@ --- id: 63ec20a06fff670d37befbd9 -title: Step 6 +title: Step 7 challengeType: 0 -dashedName: step-6 +dashedName: step-7 --- # --description-- -You now need to start adding products. Before you do that, you need to consider the structure of your product data. A product will need a unique identifier to distinguish it from other products, a price so people know how much it costs, and a name so people know what they are buying. You should also add a category to each product. +Now that you have a `Dessert` class, you can use it to create products. Each call to `new Dessert(...)` returns a new instance with the same shape, which is much shorter to write than a full object literal. -Add an object to your `products` array. Give this object an `id` property set to the number `1`, a `name` property set to the string `"Vanilla Cupcakes (6 Pack)"`, a `price` property set to the number `12.99`, and a `category` property set to the string `"Cupcake"`. +Add a single value to your `products` array by calling `new Dessert()` with these arguments, in order: the number `1`, the string `"Vanilla Cupcakes (6 Pack)"`, the number `12.99`, and the string `"Cupcake"`. # --hints-- -Your products array should have one value. +Your `products` array should have one value. ```js -assert.equal(products.length, 1); +assert.strictEqual(products.length, 1); ``` -Your products array should have an object as its first value. +The first value of your `products` array should be an instance of `Dessert`. ```js -assert.isObject(products[0]); +assert.instanceOf(products[0], Dessert); ``` -Your products array should have an object with an `id` property set to the number `1`. +Your first product should have an `id` property set to the number `1`. ```js -assert.equal(products[0].id, 1); +assert.strictEqual(products[0].id, 1); ``` -Your products array should have an object with a `name` property set to the string `"Vanilla Cupcakes (6 Pack)"`. +Your first product should have a `name` property set to the string `"Vanilla Cupcakes (6 Pack)"`. ```js -assert.equal(products[0].name, 'Vanilla Cupcakes (6 Pack)'); +assert.strictEqual(products[0].name, 'Vanilla Cupcakes (6 Pack)'); ``` -Your products array should have an object with a `price` property set to the number `12.99`. +Your first product should have a `price` property set to the number `12.99`. ```js -assert.equal(products[0].price, 12.99); +assert.strictEqual(products[0].price, 12.99); ``` -Your products array should have an object with a `category` property set to the string `"Cupcake"`. +Your first product should have a `category` property set to the string `"Cupcake"`. ```js -assert.equal(products[0].category, 'Cupcake'); +assert.strictEqual(products[0].category, 'Cupcake'); ``` # --seed-- @@ -218,6 +218,15 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + --fcc-editable-region-- const products = [ diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ec3287b182ec0efe8a3135.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ec3287b182ec0efe8a3135.md index 60121840924..089bdeacdc5 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ec3287b182ec0efe8a3135.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ec3287b182ec0efe8a3135.md @@ -1,13 +1,13 @@ --- id: 63ec3287b182ec0efe8a3135 -title: Step 7 +title: Step 8 challengeType: 0 -dashedName: step-7 +dashedName: step-8 --- # --description-- -Following that same data structure, add the products from this table (in order) to your `products` array. Increment the `id` for each product, counting up. +Add the remaining products from this table (in order) to your `products` array using `new Dessert(...)`. Increment the `id` for each product, counting up. | `name` | `price` | `category` | | ------------------------------ | ------- | ----------- | @@ -25,268 +25,275 @@ Following that same data structure, add the products from this table (in order) # --hints-- -Your second object in the `products` array should have an `id` property set to the number `2`. +Your second product should have an `id` property set to the number `2`. ```js -assert.equal(products[1].id, 2); +assert.strictEqual(products[1].id, 2); ``` -Your second object in the `products` array should have a `name` property set to `French Macaron`. +Your second product should have a `name` property set to `French Macaron`. ```js -assert.equal(products[1].name, 'French Macaron'); +assert.strictEqual(products[1].name, 'French Macaron'); ``` -Your second object in the `products` array should have a `price` property set to the number `3.99`. +Your second product should have a `price` property set to the number `3.99`. ```js -assert.equal(products[1].price, 3.99); +assert.strictEqual(products[1].price, 3.99); ``` -Your second object in the `products` array should have a `category` property set to `Macaron`. +Your second product should have a `category` property set to `Macaron`. ```js -assert.equal(products[1].category, 'Macaron'); +assert.strictEqual(products[1].category, 'Macaron'); ``` -Your third object in the `products` array should have an `id` property set to the number `3`. +Your third product should have an `id` property set to the number `3`. ```js -assert.equal(products[2].id, 3); +assert.strictEqual(products[2].id, 3); ``` -Your third object in the `products` array should have a `name` property set to `Pumpkin Cupcake`. +Your third product should have a `name` property set to `Pumpkin Cupcake`. ```js -assert.equal(products[2].name, 'Pumpkin Cupcake'); +assert.strictEqual(products[2].name, 'Pumpkin Cupcake'); ``` -Your third object in the `products` array should have a `price` property set to the number `3.99`. +Your third product should have a `price` property set to the number `3.99`. ```js -assert.equal(products[2].price, 3.99); +assert.strictEqual(products[2].price, 3.99); ``` -Your third object in the `products` array should have a `category` property set to `Cupcake`. +Your third product should have a `category` property set to `Cupcake`. ```js -assert.equal(products[2].category, 'Cupcake'); +assert.strictEqual(products[2].category, 'Cupcake'); ``` -Your fourth object in the `products` array should have an `id` property set to the number `4`. +Your fourth product should have an `id` property set to the number `4`. ```js -assert.equal(products[3].id, 4); +assert.strictEqual(products[3].id, 4); ``` -Your fourth object in the `products` array should have a `name` property set to `Chocolate Cupcake`. +Your fourth product should have a `name` property set to `Chocolate Cupcake`. ```js -assert.equal(products[3].name, 'Chocolate Cupcake'); +assert.strictEqual(products[3].name, 'Chocolate Cupcake'); ``` -Your fourth object in the `products` array should have a `price` property set to the number `5.99`. +Your fourth product should have a `price` property set to the number `5.99`. ```js -assert.equal(products[3].price, 5.99); +assert.strictEqual(products[3].price, 5.99); ``` -Your fourth object in the `products` array should have a `category` property set to `Cupcake`. +Your fourth product should have a `category` property set to `Cupcake`. ```js -assert.equal(products[3].category, 'Cupcake'); +assert.strictEqual(products[3].category, 'Cupcake'); ``` -Your fifth object in the `products` array should have an `id` property set to the number `5`. +Your fifth product should have an `id` property set to the number `5`. ```js -assert.equal(products[4].id, 5); +assert.strictEqual(products[4].id, 5); ``` -Your fifth object in the `products` array should have a `name` property set to `Chocolate Pretzels (4 Pack)`. +Your fifth product should have a `name` property set to `Chocolate Pretzels (4 Pack)`. ```js -assert.equal(products[4].name, 'Chocolate Pretzels (4 Pack)'); +assert.strictEqual(products[4].name, 'Chocolate Pretzels (4 Pack)'); ``` -Your fifth object in the `products` array should have a `price` property set to the number `10.99`. +Your fifth product should have a `price` property set to the number `10.99`. ```js -assert.equal(products[4].price, 10.99); +assert.strictEqual(products[4].price, 10.99); ``` -Your fifth object in the `products` array should have a `category` property set to `Pretzel`. +Your fifth product should have a `category` property set to `Pretzel`. ```js -assert.equal(products[4].category, 'Pretzel'); +assert.strictEqual(products[4].category, 'Pretzel'); ``` -Your sixth object in the `products` array should have an `id` property set to the number `6`. +Your sixth product should have an `id` property set to the number `6`. ```js -assert.equal(products[5].id, 6); +assert.strictEqual(products[5].id, 6); ``` -Your sixth object in the `products` array should have a `name` property set to `Strawberry Ice Cream`. +Your sixth product should have a `name` property set to `Strawberry Ice Cream`. ```js -assert.equal(products[5].name, 'Strawberry Ice Cream'); +assert.strictEqual(products[5].name, 'Strawberry Ice Cream'); ``` -Your sixth object in the `products` array should have a `price` property set to the number `2.99`. +Your sixth product should have a `price` property set to the number `2.99`. ```js -assert.equal(products[5].price, 2.99); +assert.strictEqual(products[5].price, 2.99); ``` -Your sixth object in the `products` array should have a `category` property set to `Ice Cream`. +Your sixth product should have a `category` property set to `Ice Cream`. ```js -assert.equal(products[5].category, 'Ice Cream'); +assert.strictEqual(products[5].category, 'Ice Cream'); ``` -Your seventh object in the `products` array should have an `id` property set to the number `7`. +Your seventh product should have an `id` property set to the number `7`. ```js -assert.equal(products[6].id, 7); +assert.strictEqual(products[6].id, 7); ``` -Your seventh object in the `products` array should have a `name` property set to `Chocolate Macarons (4 Pack)`. +Your seventh product should have a `name` property set to `Chocolate Macarons (4 Pack)`. ```js -assert.equal(products[6].name, 'Chocolate Macarons (4 Pack)'); +assert.strictEqual(products[6].name, 'Chocolate Macarons (4 Pack)'); ``` -Your seventh object in the `products` array should have a `price` property set to the number `9.99`. +Your seventh product should have a `price` property set to the number `9.99`. ```js -assert.equal(products[6].price, 9.99); +assert.strictEqual(products[6].price, 9.99); ``` -Your seventh object in the `products` array should have a `category` property set to `Macaron`. +Your seventh product should have a `category` property set to `Macaron`. ```js -assert.equal(products[6].category, 'Macaron'); +assert.strictEqual(products[6].category, 'Macaron'); ``` -Your eighth object in the `products` array should have an `id` property set to the number `8`. +Your eighth product should have an `id` property set to the number `8`. ```js -assert.equal(products[7].id, 8); +assert.strictEqual(products[7].id, 8); ``` -Your eighth object in the `products` array should have a `name` property set to `Strawberry Pretzel`. +Your eighth product should have a `name` property set to `Strawberry Pretzel`. ```js -assert.equal(products[7].name, 'Strawberry Pretzel'); +assert.strictEqual(products[7].name, 'Strawberry Pretzel'); ``` -Your eighth object in the `products` array should have a `price` property set to the number `4.99`. +Your eighth product should have a `price` property set to the number `4.99`. ```js -assert.equal(products[7].price, 4.99); +assert.strictEqual(products[7].price, 4.99); ``` -Your eighth object in the `products` array should have a `category` property set to `Pretzel`. +Your eighth product should have a `category` property set to `Pretzel`. ```js -assert.equal(products[7].category, 'Pretzel'); +assert.strictEqual(products[7].category, 'Pretzel'); ``` -Your ninth object in the `products` array should have an `id` property set to the number `9`. +Your ninth product should have an `id` property set to the number `9`. ```js -assert.equal(products[8].id, 9); +assert.strictEqual(products[8].id, 9); ``` -Your ninth object in the `products` array should have a `name` property set to `Butter Pecan Ice Cream`. +Your ninth product should have a `name` property set to `Butter Pecan Ice Cream`. ```js -assert.equal(products[8].name, 'Butter Pecan Ice Cream'); +assert.strictEqual(products[8].name, 'Butter Pecan Ice Cream'); ``` -Your ninth object in the `products` array should have a `price` property set to the number `2.99`. +Your ninth product should have a `price` property set to the number `2.99`. ```js -assert.equal(products[8].price, 2.99); +assert.strictEqual(products[8].price, 2.99); ``` -Your ninth object in the `products` array should have a `category` property set to `Ice Cream`. +Your ninth product should have a `category` property set to `Ice Cream`. ```js -assert.equal(products[8].category, 'Ice Cream'); +assert.strictEqual(products[8].category, 'Ice Cream'); ``` -Your tenth object in the `products` array should have an `id` property set to the number `10`. +Your tenth product should have an `id` property set to the number `10`. ```js -assert.equal(products[9].id, 10); +assert.strictEqual(products[9].id, 10); ``` -Your tenth object in the `products` array should have a `name` property set to `Rocky Road Ice Cream`. +Your tenth product should have a `name` property set to `Rocky Road Ice Cream`. ```js -assert.equal(products[9].name, 'Rocky Road Ice Cream'); +assert.strictEqual(products[9].name, 'Rocky Road Ice Cream'); ``` -Your tenth object in the `products` array should have a `price` property set to the number `2.99`. +Your tenth product should have a `price` property set to the number `2.99`. ```js -assert.equal(products[9].price, 2.99); +assert.strictEqual(products[9].price, 2.99); ``` -Your tenth object in the `products` array should have a `category` property set to `Ice Cream`. +Your tenth product should have a `category` property set to `Ice Cream`. ```js -assert.equal(products[9].category, 'Ice Cream'); +assert.strictEqual(products[9].category, 'Ice Cream'); ``` -Your eleventh object in the `products` array should have an `id` property set to the number `11`. +Your eleventh product should have an `id` property set to the number `11`. ```js -assert.equal(products[10].id, 11); +assert.strictEqual(products[10].id, 11); ``` -Your eleventh object in the `products` array should have a `name` property set to `Vanilla Macarons (5 Pack)`. +Your eleventh product should have a `name` property set to `Vanilla Macarons (5 Pack)`. ```js -assert.equal(products[10].name, 'Vanilla Macarons (5 Pack)'); +assert.strictEqual(products[10].name, 'Vanilla Macarons (5 Pack)'); ``` -Your eleventh object in the `products` array should have a `price` property set to the number `11.99`. +Your eleventh product should have a `price` property set to the number `11.99`. ```js -assert.equal(products[10].price, 11.99); +assert.strictEqual(products[10].price, 11.99); ``` -Your eleventh object in the `products` array should have a `category` property set to `Macaron`. +Your eleventh product should have a `category` property set to `Macaron`. ```js -assert.equal(products[10].category, 'Macaron'); +assert.strictEqual(products[10].category, 'Macaron'); ``` -Your twelfth object in the `products` array should have an `id` property set to the number `12`. +Your twelfth product should have an `id` property set to the number `12`. ```js -assert.equal(products[11].id, 12); +assert.strictEqual(products[11].id, 12); ``` -Your twelfth object in the `products` array should have a `name` property set to `Lemon Cupcakes (4 Pack)`. +Your twelfth product should have a `name` property set to `Lemon Cupcakes (4 Pack)`. ```js -assert.equal(products[11].name, 'Lemon Cupcakes (4 Pack)'); +assert.strictEqual(products[11].name, 'Lemon Cupcakes (4 Pack)'); ``` -Your twelfth object in the `products` array should have a `price` property set to the number `12.99`. +Your twelfth product should have a `price` property set to the number `12.99`. ```js -assert.equal(products[11].price, 12.99); +assert.strictEqual(products[11].price, 12.99); ``` -Your twelfth object in the `products` array should have a `category` property set to `Cupcake`. +Your twelfth product should have a `category` property set to `Cupcake`. ```js -assert.equal(products[11].category, 'Cupcake'); +assert.strictEqual(products[11].category, 'Cupcake'); +``` + +Your `products` array should have 12 values, each an instance of `Dessert`. + +```js +assert.strictEqual(products.length, 12); +products.forEach(p => assert.instanceOf(p, Dessert)); ``` # --seed-- @@ -458,14 +465,18 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + --fcc-editable-region-- const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), ]; --fcc-editable-region-- diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ec3427fc3e9214c9ed2a14.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ec3427fc3e9214c9ed2a14.md index 49356c072d7..e6619ca0e2b 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ec3427fc3e9214c9ed2a14.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ec3427fc3e9214c9ed2a14.md @@ -1,8 +1,8 @@ --- id: 63ec3427fc3e9214c9ed2a14 -title: Step 8 +title: Step 9 challengeType: 0 -dashedName: step-8 +dashedName: step-9 --- # --description-- @@ -200,79 +200,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; --fcc-editable-region-- diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ec36f6133df7160be3ec66.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ec36f6133df7160be3ec66.md index 7b152a27c59..4ba2532db4f 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ec36f6133df7160be3ec66.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ec36f6133df7160be3ec66.md @@ -1,15 +1,15 @@ --- id: 63ec36f6133df7160be3ec66 -title: Step 9 +title: Step 10 challengeType: 0 -dashedName: step-9 +dashedName: step-10 --- # --description-- Remember that you can use destructuring to extract multiple values from an array or object in a single statement. -For the first parameter of your callback function, destructure the `name`, `id`, `price`, and `category` properties from the object passed in. +For the first parameter of your callback function, destructure the `name`, `id`, `price`, and `category` properties from the `Dessert` instance passed in. # --hints-- @@ -194,79 +194,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; --fcc-editable-region-- diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ec47b454495519739486a7.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ec47b454495519739486a7.md index 41a772b43c3..a606cbae251 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ec47b454495519739486a7.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ec47b454495519739486a7.md @@ -1,8 +1,8 @@ --- id: 63ec47b454495519739486a7 -title: Step 10 +title: Step 11 challengeType: 0 -dashedName: step-10 +dashedName: step-11 --- # --description-- @@ -11,7 +11,7 @@ You need to display the available products in your HTML. Start by using the addi # --hints-- -You should use access the `innerHTML` property of the `dessertCards` variable. +You should access the `innerHTML` property of the `dessertCards` variable. ```js assert.match(code, /dessertCards\.innerHTML/); @@ -198,79 +198,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; --fcc-editable-region-- diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee5d38a5d29d0696f8d820.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee5d38a5d29d0696f8d820.md index 4164864656d..a254b5ad3a9 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee5d38a5d29d0696f8d820.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee5d38a5d29d0696f8d820.md @@ -1,8 +1,8 @@ --- id: 63ee5d38a5d29d0696f8d820 -title: Step 11 +title: Step 12 challengeType: 0 -dashedName: step-11 +dashedName: step-12 --- # --description-- @@ -20,7 +20,7 @@ assert.isAtLeast(document.querySelectorAll('div')?.length, 12); Your `div` element should have a class of `dessert-card`. ```js -assert.equal(document.querySelectorAll('.dessert-card')?.length, 12); +assert.strictEqual(document.querySelectorAll('.dessert-card')?.length, 12); ``` You should create an `h2` element. @@ -32,13 +32,13 @@ assert.isAtLeast(document.querySelectorAll('h2')?.length, 12); Your `h2` element should have the text of the `name` variable. ```js -assert.equal(document.querySelectorAll('h2')[0]?.textContent, 'Vanilla Cupcakes (6 Pack)'); +assert.strictEqual(document.querySelectorAll('h2')[0]?.textContent, 'Vanilla Cupcakes (6 Pack)'); ``` Your `h2` element should be inside the `div` element. ```js -assert.equal(document.querySelectorAll('div h2')?.length, 12); +assert.strictEqual(document.querySelectorAll('div h2')?.length, 12); ``` # --seed-- @@ -210,79 +210,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; --fcc-editable-region-- diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee5d8f9e7168076e932fe2.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee5d8f9e7168076e932fe2.md index 2a35a0f1200..c5099112f8f 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee5d8f9e7168076e932fe2.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee5d8f9e7168076e932fe2.md @@ -1,8 +1,8 @@ --- id: 63ee5d8f9e7168076e932fe2 -title: Step 12 +title: Step 13 challengeType: 0 -dashedName: step-12 +dashedName: step-13 --- # --description-- @@ -14,40 +14,40 @@ After your `h2` element, create two `p` elements. Give the first a `class` of `d You should create two `p` elements. ```js -assert.equal(document.querySelector('.dessert-card')?.children.length, 3); -assert.equal(document.querySelector('.dessert-card')?.querySelectorAll('p')?.length, 2) +assert.strictEqual(document.querySelector('.dessert-card')?.children.length, 3); +assert.strictEqual(document.querySelector('.dessert-card')?.querySelectorAll('p')?.length, 2) ``` Your `p` elements should come after your `h2` element. ```js -assert.equal(document.querySelector('.dessert-card')?.children[0].tagName, 'H2'); -assert.equal(document.querySelector('.dessert-card')?.children[1].tagName, 'P'); -assert.equal(document.querySelector('.dessert-card')?.children[2].tagName, 'P'); +assert.strictEqual(document.querySelector('.dessert-card')?.children[0].tagName, 'H2'); +assert.strictEqual(document.querySelector('.dessert-card')?.children[1].tagName, 'P'); +assert.strictEqual(document.querySelector('.dessert-card')?.children[2].tagName, 'P'); ``` Your first `p` element should have a `class` of `dessert-price`. ```js -assert.equal(document.querySelector('.dessert-card')?.children[1].className, 'dessert-price'); +assert.strictEqual(document.querySelector('.dessert-card')?.children[1].className, 'dessert-price'); ``` Your first `p` element should have the dollar sign `"$"` followed by the value of the `price` variable. ```js -assert.equal(document.querySelector('.dessert-card')?.children[1].textContent, '$12.99'); +assert.strictEqual(document.querySelector('.dessert-card')?.children[1].textContent, '$12.99'); ``` Your second `p` element should have a `class` of `product-category`. ```js -assert.equal(document.querySelector('.dessert-card')?.children[2].className, 'product-category'); +assert.strictEqual(document.querySelector('.dessert-card')?.children[2].className, 'product-category'); ``` Your second `p` element should have the text `"Category: "` followed by the value of the `category` variable. ```js -assert.equal(document.querySelector('.dessert-card')?.children[2].textContent, 'Category: Cupcake'); +assert.strictEqual(document.querySelector('.dessert-card')?.children[2].textContent, 'Category: Cupcake'); ``` # --seed-- @@ -219,79 +219,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; --fcc-editable-region-- diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee5e0f08e82208364c4128.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee5e0f08e82208364c4128.md index b80d822dac4..f8a102c930e 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee5e0f08e82208364c4128.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee5e0f08e82208364c4128.md @@ -1,8 +1,8 @@ --- id: 63ee5e0f08e82208364c4128 -title: Step 13 +title: Step 14 challengeType: 0 -dashedName: step-13 +dashedName: step-14 --- # --description-- @@ -14,20 +14,20 @@ Finally, after your `p` elements, create a `button` element. Give it an `id` set You should create a `button` element. ```js -assert.equal(document.querySelectorAll('.dessert-card button')?.length, 12); +assert.strictEqual(document.querySelectorAll('.dessert-card button')?.length, 12); ``` Your `button` element should come after your `p` elements. ```js -assert.equal(document.querySelector('.dessert-card button')?.previousElementSibling?.tagName, 'P'); +assert.strictEqual(document.querySelector('.dessert-card button')?.previousElementSibling?.tagName, 'P'); assert.isNull(document.querySelector('.dessert-card button')?.nextElementSibling); ``` Your `button` element should have an `id` set to the value of the `id` variable. ```js -assert.equal(document.querySelector('.dessert-card button')?.id, '1'); +assert.strictEqual(document.querySelector('.dessert-card button')?.id, '1'); ``` Your `button` element should have a `class` of `btn add-to-cart-btn`. @@ -40,7 +40,7 @@ assert.include(document.querySelector('.dessert-card button')?.className, 'add-t Your `button` element should have the text `"Add to cart"`. ```js -assert.equal(document.querySelector('.dessert-card button')?.textContent?.trim(), 'Add to cart'); +assert.strictEqual(document.querySelector('.dessert-card button')?.textContent?.trim(), 'Add to cart'); ``` # --seed-- @@ -212,79 +212,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; --fcc-editable-region-- diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee5ea8be892e0955ab346c.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee5ea8be892e0955ab346c.md index 2c787d6d675..1ad57af8a95 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee5ea8be892e0955ab346c.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee5ea8be892e0955ab346c.md @@ -1,21 +1,13 @@ --- id: 63ee5ea8be892e0955ab346c -title: Step 14 +title: Step 15 challengeType: 0 -dashedName: step-14 +dashedName: step-15 --- # --description-- -You are already familiar with an HTML `class`, but JavaScript also has a class. In JavaScript, a class is like a blueprint for creating objects. It allows you to define a set of properties and methods, and instantiate (or create) new objects with those properties and methods. - -The `class` keyword is used to declare a class. Here is an example of declaring a `Computer` class: - -```js -class Computer {}; -``` - -Declare a `ShoppingCart` class. +Now that you have created a `Dessert` class, create a `ShoppingCart` class. # --hints-- @@ -206,79 +198,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee5fc113bcb20a5db9214b.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee5fc113bcb20a5db9214b.md index 9c65f227b3f..ce91618f65d 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee5fc113bcb20a5db9214b.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee5fc113bcb20a5db9214b.md @@ -1,8 +1,8 @@ --- id: 63ee5fc113bcb20a5db9214b -title: Step 15 +title: Step 16 challengeType: 0 -dashedName: step-15 +dashedName: step-16 --- # --description-- @@ -201,79 +201,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee611d478dca0b77f6a393.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee611d478dca0b77f6a393.md index 1b3600767b9..6eaff2419ee 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee611d478dca0b77f6a393.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee611d478dca0b77f6a393.md @@ -1,13 +1,13 @@ --- id: 63ee611d478dca0b77f6a393 -title: Step 16 +title: Step 17 challengeType: 0 -dashedName: step-16 +dashedName: step-17 --- # --description-- -The `this` keyword in JavaScript is used to refer to the current object. Depending on where `this` is used, what it references changes. In the case of a class, it refers to the instance of the object being constructed. You can use the `this` keyword to set the properties of the object being instantiated. Here is an example: +You learned in a previous lecture that the `this` keyword refers to the current instance being constructed, as you saw in the `Dessert` constructor. Here, you will apply the same idea to the `ShoppingCart` class. ```js class Computer { @@ -35,7 +35,7 @@ You should use the `this` keyword to set the `total` property of your class to ` ```js assert.match(code, /this\.total/); const cart = new ShoppingCart(); -assert.equal(cart.total, 0); +assert.strictEqual(cart.total, 0); ``` You should use the `this` keyword to set the `taxRate` property of your class to `8.25`. @@ -43,7 +43,7 @@ You should use the `this` keyword to set the `taxRate` property of your class to ```js assert.match(code, /this\.taxRate/); const cart = new ShoppingCart(); -assert.equal(cart.taxRate, 8.25); +assert.strictEqual(cart.taxRate, 8.25); ``` # --seed-- @@ -215,79 +215,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee7c664f9b65137d925c8a.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee7c664f9b65137d925c8a.md index 92c4de31c7e..aa05ce42a1d 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee7c664f9b65137d925c8a.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63ee7c664f9b65137d925c8a.md @@ -1,8 +1,8 @@ --- id: 63ee7c664f9b65137d925c8a -title: Step 17 +title: Step 18 challengeType: 0 -dashedName: step-17 +dashedName: step-18 --- # --description-- @@ -21,7 +21,7 @@ class Computer { } ``` -The first parameter, `id`, is the `id` of the product the user has added to their cart. The second parameter, `products`, is an array of product objects. By using a parameter instead of directly referencing your existing `products` array, this method will be more flexible if you wanted to add additional product lists in the future. +The first parameter, `id`, is the `id` of the product the user has added to their cart. The second parameter, `products`, is an array of `Dessert` instances. By using a parameter instead of directly referencing your existing `products` array, this method will be more flexible if you wanted to add additional product lists in the future. # --hints-- @@ -216,79 +216,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63eea5cea403a81a68ae493c.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63eea5cea403a81a68ae493c.md index affc2cfb2de..b58339b1628 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63eea5cea403a81a68ae493c.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63eea5cea403a81a68ae493c.md @@ -1,8 +1,8 @@ --- id: 63eea5cea403a81a68ae493c -title: Step 18 +title: Step 19 challengeType: 0 -dashedName: step-18 +dashedName: step-19 --- # --description-- @@ -227,79 +227,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63eea817673c8e1c22927fa6.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63eea817673c8e1c22927fa6.md index deb7c4fe9dd..982b81479d7 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63eea817673c8e1c22927fa6.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63eea817673c8e1c22927fa6.md @@ -1,8 +1,8 @@ --- id: 63eea817673c8e1c22927fa6 -title: Step 19 +title: Step 20 challengeType: 0 -dashedName: step-19 +dashedName: step-20 --- # --description-- @@ -201,79 +201,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63eea8e1e143ae1d098c8c9d.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63eea8e1e143ae1d098c8c9d.md index 37c9026961f..7c8fb6bd4f5 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63eea8e1e143ae1d098c8c9d.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63eea8e1e143ae1d098c8c9d.md @@ -1,8 +1,8 @@ --- id: 63eea8e1e143ae1d098c8c9d -title: Step 20 +title: Step 21 challengeType: 0 -dashedName: step-20 +dashedName: step-21 --- # --description-- @@ -202,79 +202,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63eeb8e86becbf1e75c2cb0d.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63eeb8e86becbf1e75c2cb0d.md index b4ae769e775..7fba992e90a 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63eeb8e86becbf1e75c2cb0d.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63eeb8e86becbf1e75c2cb0d.md @@ -1,8 +1,8 @@ --- id: 63eeb8e86becbf1e75c2cb0d -title: Step 21 +title: Step 22 challengeType: 0 -dashedName: step-21 +dashedName: step-22 --- # --description-- @@ -201,79 +201,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63eedebb0ec0231ff1cede1a.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63eedebb0ec0231ff1cede1a.md index 51a98fe3d44..5efce002270 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63eedebb0ec0231ff1cede1a.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63eedebb0ec0231ff1cede1a.md @@ -1,8 +1,8 @@ --- id: 63eedebb0ec0231ff1cede1a -title: Step 22 +title: Step 23 challengeType: 0 -dashedName: step-22 +dashedName: step-23 --- # --description-- @@ -215,79 +215,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63efdbc22a0c56070beabed7.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63efdbc22a0c56070beabed7.md index 2fcec338124..4aa49735f16 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63efdbc22a0c56070beabed7.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63efdbc22a0c56070beabed7.md @@ -1,8 +1,8 @@ --- id: 63efdbc22a0c56070beabed7 -title: Step 23 +title: Step 24 challengeType: 0 -dashedName: step-23 +dashedName: step-24 --- # --description-- @@ -218,79 +218,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63efe370bbfc4a08d500118e.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63efe370bbfc4a08d500118e.md index f7efb0a8644..5f5c18de667 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63efe370bbfc4a08d500118e.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63efe370bbfc4a08d500118e.md @@ -1,8 +1,8 @@ --- id: 63efe370bbfc4a08d500118e -title: Step 24 +title: Step 25 challengeType: 0 -dashedName: step-24 +dashedName: step-25 --- # --description-- @@ -208,79 +208,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63eff02f00e69a0b2ac10b43.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63eff02f00e69a0b2ac10b43.md index 6e522de2398..f1889708267 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63eff02f00e69a0b2ac10b43.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63eff02f00e69a0b2ac10b43.md @@ -1,8 +1,8 @@ --- id: 63eff02f00e69a0b2ac10b43 -title: Step 25 +title: Step 26 challengeType: 0 -dashedName: step-25 +dashedName: step-26 --- # --description-- @@ -201,79 +201,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63eff98ffb1d5a0d24ec79cb.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63eff98ffb1d5a0d24ec79cb.md index 9adff65e50c..f0ba274d75b 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63eff98ffb1d5a0d24ec79cb.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63eff98ffb1d5a0d24ec79cb.md @@ -1,8 +1,8 @@ --- id: 63eff98ffb1d5a0d24ec79cb -title: Step 26 +title: Step 27 challengeType: 0 -dashedName: step-26 +dashedName: step-27 --- # --description-- @@ -219,79 +219,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63effe558c87a70e7072e447.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63effe558c87a70e7072e447.md index c355e87360e..a9c1fb3a6db 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63effe558c87a70e7072e447.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63effe558c87a70e7072e447.md @@ -1,8 +1,8 @@ --- id: 63effe558c87a70e7072e447 -title: Step 27 +title: Step 28 challengeType: 0 -dashedName: step-27 +dashedName: step-28 --- # --description-- @@ -208,79 +208,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0165121a9181342d5bc66.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0165121a9181342d5bc66.md index 998ae1198c8..23f1ad6a2d6 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0165121a9181342d5bc66.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0165121a9181342d5bc66.md @@ -1,8 +1,8 @@ --- id: 63f0165121a9181342d5bc66 -title: Step 28 +title: Step 29 challengeType: 0 -dashedName: step-28 +dashedName: step-29 --- # --description-- @@ -201,79 +201,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f017b4ad028a148eb713c0.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f017b4ad028a148eb713c0.md index c1d44171da9..dbf41b79d54 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f017b4ad028a148eb713c0.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f017b4ad028a148eb713c0.md @@ -1,8 +1,8 @@ --- id: 63f017b4ad028a148eb713c0 -title: Step 29 +title: Step 30 challengeType: 0 -dashedName: step-29 +dashedName: step-30 --- # --description-- @@ -36,7 +36,7 @@ You should add a `div` to the `productsContainer`. ```js const cart = new ShoppingCart(); cart.addItem(1, products); -assert.equal(productsContainer.children?.[0]?.tagName, "DIV"); +assert.strictEqual(productsContainer.children?.[0]?.tagName, "DIV"); ``` Your `div` should have the `class` set to `product`. @@ -44,7 +44,7 @@ Your `div` should have the `class` set to `product`. ```js const cart = new ShoppingCart(); cart.addItem(1, products); -assert.equal(productsContainer.children?.[0]?.className, "product"); +assert.strictEqual(productsContainer.children?.[0]?.className, "product"); ``` Your `div` should have the `id` set to `dessert${id}`. @@ -52,7 +52,7 @@ Your `div` should have the `id` set to `dessert${id}`. ```js const cart = new ShoppingCart(); cart.addItem(1, products); -assert.equal(productsContainer.children?.[0]?.id, "dessert1"); +assert.strictEqual(productsContainer.children?.[0]?.id, "dessert1"); ``` # --seed-- @@ -224,79 +224,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f01861f813e01564c95315.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f01861f813e01564c95315.md index 9768459c663..e51b5f585ef 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f01861f813e01564c95315.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f01861f813e01564c95315.md @@ -1,8 +1,8 @@ --- id: 63f01861f813e01564c95315 -title: Step 30 +title: Step 31 challengeType: 0 -dashedName: step-30 +dashedName: step-31 --- # --description-- @@ -17,9 +17,9 @@ You should add two `p` elements inside your `div` element. const cart = new ShoppingCart(); cart.addItem(1, products); const div = document.querySelector('.product'); -assert.equal(div?.children.length, 2); -assert.equal(div?.children[0].tagName, 'P'); -assert.equal(div?.children[1].tagName, 'P'); +assert.strictEqual(div?.children.length, 2); +assert.strictEqual(div?.children[0].tagName, 'P'); +assert.strictEqual(div?.children[1].tagName, 'P'); ``` Your second `p` element should have the text of the `price` variable. @@ -28,7 +28,7 @@ Your second `p` element should have the text of the `price` variable. const cart = new ShoppingCart(); cart.addItem(1, products); const div = document.querySelector('.product'); -assert.equal(div?.children[1].textContent, '12.99'); +assert.strictEqual(div?.children[1].textContent, '12.99'); ``` # --seed-- @@ -200,79 +200,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f018f04e487e164dc27bd9.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f018f04e487e164dc27bd9.md index a2bb5d14a8f..c869ecde9d4 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f018f04e487e164dc27bd9.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f018f04e487e164dc27bd9.md @@ -1,8 +1,8 @@ --- id: 63f018f04e487e164dc27bd9 -title: Step 31 +title: Step 32 challengeType: 0 -dashedName: step-31 +dashedName: step-32 --- # --description-- @@ -18,8 +18,8 @@ const cart = new ShoppingCart(); cart.addItem(1, products); const div = document.querySelector('.product'); const p = div.querySelector('p'); -assert.equal(p.children.length, 1); -assert.equal(p.children[0].tagName, 'SPAN'); +assert.strictEqual(p.children.length, 1); +assert.strictEqual(p.children[0].tagName, 'SPAN'); ``` Your `span` element should have a `class` of `product-count`. @@ -29,7 +29,7 @@ const cart = new ShoppingCart(); cart.addItem(1, products); const div = document.querySelector('.product'); const p = div.querySelector('p'); -assert.equal(p.children[0].className, 'product-count'); +assert.strictEqual(p.children[0].className, 'product-count'); ``` Your `span` element should have an `id` of `product-count-for-id${id}`. @@ -39,7 +39,7 @@ const cart = new ShoppingCart(); cart.addItem(1, products); const div = document.querySelector('.product'); const p = div.querySelector('p'); -assert.equal(p.children[0].id, 'product-count-for-id1'); +assert.strictEqual(p.children[0].id, 'product-count-for-id1'); ``` Your first `p` element should have the text of the `name` variable. This should be outside the span. @@ -49,7 +49,7 @@ const cart = new ShoppingCart(); cart.addItem(1, products); const div = document.querySelector('.product'); const p = div.querySelector('p'); -assert.equal(p.innerText.trim(), 'Vanilla Cupcakes (6 Pack)'); +assert.strictEqual(p.innerText.trim(), 'Vanilla Cupcakes (6 Pack)'); ``` # --seed-- @@ -221,79 +221,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f01c9791a0aa1751c73760.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f01c9791a0aa1751c73760.md index 16c96f58571..eac90f0d764 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f01c9791a0aa1751c73760.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f01c9791a0aa1751c73760.md @@ -1,8 +1,8 @@ --- id: 63f01c9791a0aa1751c73760 -title: Step 32 +title: Step 33 challengeType: 0 -dashedName: step-32 +dashedName: step-33 --- # --description-- @@ -204,79 +204,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0224ceb16dc196d2c860a.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0224ceb16dc196d2c860a.md index 7dc61b29e99..cd83ec0763b 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0224ceb16dc196d2c860a.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0224ceb16dc196d2c860a.md @@ -1,8 +1,8 @@ --- id: 63f0224ceb16dc196d2c860a -title: Step 33 +title: Step 34 challengeType: 0 -dashedName: step-33 +dashedName: step-34 --- # --description-- @@ -204,79 +204,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f026d041bc6c1a3d5cba0f.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f026d041bc6c1a3d5cba0f.md index 12b72015e20..3632a5db37e 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f026d041bc6c1a3d5cba0f.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f026d041bc6c1a3d5cba0f.md @@ -1,8 +1,8 @@ --- id: 63f026d041bc6c1a3d5cba0f -title: Step 34 +title: Step 35 challengeType: 0 -dashedName: step-34 +dashedName: step-35 --- # --description-- @@ -206,79 +206,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0284532742c1b26c7a052.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0284532742c1b26c7a052.md index 37cc1dc971b..833346c7042 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0284532742c1b26c7a052.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0284532742c1b26c7a052.md @@ -1,8 +1,8 @@ --- id: 63f0284532742c1b26c7a052 -title: Step 35 +title: Step 36 challengeType: 0 -dashedName: step-35 +dashedName: step-36 --- # --description-- @@ -204,79 +204,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0289df84a581bbdbd29b7.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0289df84a581bbdbd29b7.md index 1783aa5f2ed..4d327793f7a 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0289df84a581bbdbd29b7.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0289df84a581bbdbd29b7.md @@ -1,8 +1,8 @@ --- id: 63f0289df84a581bbdbd29b7 -title: Step 36 +title: Step 37 challengeType: 0 -dashedName: step-36 +dashedName: step-37 --- # --description-- @@ -200,79 +200,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0295e673b661ccb299e8a.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0295e673b661ccb299e8a.md index 96dd50bc9c6..851cd39cf2c 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0295e673b661ccb299e8a.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0295e673b661ccb299e8a.md @@ -1,8 +1,8 @@ --- id: 63f0295e673b661ccb299e8a -title: Step 41 +title: Step 42 challengeType: 0 -dashedName: step-41 +dashedName: step-42 --- # --description-- @@ -29,9 +29,9 @@ assert.match(afterCounts, /this\s*\.\s*items\s*\.\s*length/); Your `getCounts` method should return the number of items in the `items` array. ```js -assert.equal(cart.getCounts(), 0); +assert.strictEqual(cart.getCounts(), 0); cart.addItem(1, products); -assert.equal(cart.getCounts(), 1); +assert.strictEqual(cart.getCounts(), 1); ``` # --seed-- @@ -203,79 +203,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f029b96b9e9e1df93be951.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f029b96b9e9e1df93be951.md index 5134f6d230c..18a206b3332 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f029b96b9e9e1df93be951.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f029b96b9e9e1df93be951.md @@ -1,8 +1,8 @@ --- id: 63f029b96b9e9e1df93be951 -title: Step 42 +title: Step 43 challengeType: 0 -dashedName: step-42 +dashedName: step-43 --- # --description-- @@ -192,79 +192,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f02a4ef92d711ec1ff618c.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f02a4ef92d711ec1ff618c.md index a8e3a43707d..72d9593252c 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f02a4ef92d711ec1ff618c.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f02a4ef92d711ec1ff618c.md @@ -1,8 +1,8 @@ --- id: 63f02a4ef92d711ec1ff618c -title: Step 43 +title: Step 44 challengeType: 0 -dashedName: step-43 +dashedName: step-44 --- # --description-- @@ -225,79 +225,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f02b22cce1c11fe9604381.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f02b22cce1c11fe9604381.md index 0a6c5466a20..278c0e5f4d9 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f02b22cce1c11fe9604381.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f02b22cce1c11fe9604381.md @@ -1,8 +1,8 @@ --- id: 63f02b22cce1c11fe9604381 -title: Step 44 +title: Step 45 challengeType: 0 -dashedName: step-44 +dashedName: step-45 --- # --description-- @@ -192,79 +192,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f02bdeb9b428208b97eb6b.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f02bdeb9b428208b97eb6b.md index 8b282aa164a..97e64a5f22c 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f02bdeb9b428208b97eb6b.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f02bdeb9b428208b97eb6b.md @@ -1,8 +1,8 @@ --- id: 63f02bdeb9b428208b97eb6b -title: Step 45 +title: Step 46 challengeType: 0 -dashedName: step-45 +dashedName: step-46 --- # --description-- @@ -37,7 +37,7 @@ assert.match(afterCalculateTaxes, /amount\s*\*\s*\(\s*this\s*\.\s*taxRate\s*\/\s Your `calculateTaxes` method should return the value of the `taxRate` (divided by 100, to convert it to a percent) multiplied by the `amount` parameter. ```js -assert.equal(cart.calculateTaxes(10), (cart.taxRate / 100) * 10); +assert.strictEqual(cart.calculateTaxes(10), (cart.taxRate / 100) * 10); ``` # --seed-- @@ -209,79 +209,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f02c6e18773921ba50aa53.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f02c6e18773921ba50aa53.md index d2916d079ea..206391a71a2 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f02c6e18773921ba50aa53.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f02c6e18773921ba50aa53.md @@ -1,8 +1,8 @@ --- id: 63f02c6e18773921ba50aa53 -title: Step 46 +title: Step 47 challengeType: 0 -dashedName: step-46 +dashedName: step-47 --- # --description-- @@ -203,79 +203,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0311f5ea9382388d6124f.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0311f5ea9382388d6124f.md index 724b478e2d5..a172b414035 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0311f5ea9382388d6124f.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0311f5ea9382388d6124f.md @@ -1,8 +1,8 @@ --- id: 63f0311f5ea9382388d6124f -title: Step 47 +title: Step 48 challengeType: 0 -dashedName: step-47 +dashedName: step-48 --- # --description-- @@ -189,79 +189,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f033fdb1fbcc254999fcc3.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f033fdb1fbcc254999fcc3.md index 30fd759f6e3..025e905a005 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f033fdb1fbcc254999fcc3.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f033fdb1fbcc254999fcc3.md @@ -1,8 +1,8 @@ --- id: 63f033fdb1fbcc254999fcc3 -title: Step 37 +title: Step 38 challengeType: 0 -dashedName: step-37 +dashedName: step-38 --- # --description-- @@ -198,79 +198,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03446c2ed3e264be6c7fc.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03446c2ed3e264be6c7fc.md index f90da8eb85e..06dae7e8d37 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03446c2ed3e264be6c7fc.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03446c2ed3e264be6c7fc.md @@ -1,8 +1,8 @@ --- id: 63f03446c2ed3e264be6c7fc -title: Step 38 +title: Step 39 challengeType: 0 -dashedName: step-38 +dashedName: step-39 --- # --description-- @@ -192,79 +192,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0348a54a177272071a595.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0348a54a177272071a595.md index f92e2f7d7e1..6a40004837d 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0348a54a177272071a595.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0348a54a177272071a595.md @@ -1,8 +1,8 @@ --- id: 63f0348a54a177272071a595 -title: Step 39 +title: Step 40 challengeType: 0 -dashedName: step-39 +dashedName: step-40 --- # --description-- @@ -204,79 +204,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f034d012f74627ce538d3a.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f034d012f74627ce538d3a.md index 9b37eac1fe3..705e4b8fba7 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f034d012f74627ce538d3a.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f034d012f74627ce538d3a.md @@ -1,8 +1,8 @@ --- id: 63f034d012f74627ce538d3a -title: Step 40 +title: Step 41 challengeType: 0 -dashedName: step-40 +dashedName: step-41 --- # --description-- @@ -212,79 +212,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03686c5ea863533ec71f4.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03686c5ea863533ec71f4.md index 409441e7002..5d147e37a50 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03686c5ea863533ec71f4.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03686c5ea863533ec71f4.md @@ -1,8 +1,8 @@ --- id: 63f03686c5ea863533ec71f4 -title: Step 48 +title: Step 49 challengeType: 0 -dashedName: step-48 +dashedName: step-49 --- # --description-- @@ -194,79 +194,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f036ec91fdf238c90665f5.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f036ec91fdf238c90665f5.md index fb997d0fe82..8471868dbc5 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f036ec91fdf238c90665f5.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f036ec91fdf238c90665f5.md @@ -1,8 +1,8 @@ --- id: 63f036ec91fdf238c90665f5 -title: Step 49 +title: Step 50 challengeType: 0 -dashedName: step-49 +dashedName: step-50 --- # --description-- @@ -192,79 +192,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0370b340915399d31e5eb.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0370b340915399d31e5eb.md index 6b2be8c5013..655282100cc 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0370b340915399d31e5eb.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0370b340915399d31e5eb.md @@ -1,8 +1,8 @@ --- id: 63f0370b340915399d31e5eb -title: Step 50 +title: Step 51 challengeType: 0 -dashedName: step-50 +dashedName: step-51 --- # --description-- @@ -206,79 +206,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0374d5351223a747c301d.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0374d5351223a747c301d.md index ea862dc5bf1..1a818cb6950 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0374d5351223a747c301d.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0374d5351223a747c301d.md @@ -1,8 +1,8 @@ --- id: 63f0374d5351223a747c301d -title: Step 51 +title: Step 52 challengeType: 0 -dashedName: step-51 +dashedName: step-52 --- # --description-- @@ -232,79 +232,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0378e173e3c3b7638b528.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0378e173e3c3b7638b528.md index bda015b9db4..7b1b563ed8b 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0378e173e3c3b7638b528.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f0378e173e3c3b7638b528.md @@ -1,8 +1,8 @@ --- id: 63f0378e173e3c3b7638b528 -title: Step 52 +title: Step 53 challengeType: 0 -dashedName: step-52 +dashedName: step-53 --- # --description-- @@ -14,7 +14,7 @@ Finally, return the value of the `total` property. Remember your `this` keyword. Your `calculateTotal` method should return the value of the `total` property. ```js -assert.equal(cart.calculateTotal(), 0); +assert.strictEqual(cart.calculateTotal(), 0); cart.addItem(1, products); assert.approximately(cart.calculateTotal(), 14.06, 0.1); ``` @@ -188,79 +188,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f038a0ae041d3c5b0cdf23.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f038a0ae041d3c5b0cdf23.md index 68dca7c389e..2603270aa94 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f038a0ae041d3c5b0cdf23.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f038a0ae041d3c5b0cdf23.md @@ -1,8 +1,8 @@ --- id: 63f038a0ae041d3c5b0cdf23 -title: Step 54 +title: Step 55 challengeType: 0 -dashedName: step-54 +dashedName: step-55 --- # --description-- @@ -186,79 +186,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f038e671d3f73d5a041973.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f038e671d3f73d5a041973.md index 2eeab13036c..a16ea6888d6 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f038e671d3f73d5a041973.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f038e671d3f73d5a041973.md @@ -1,8 +1,8 @@ --- id: 63f038e671d3f73d5a041973 -title: Step 55 +title: Step 56 challengeType: 0 -dashedName: step-55 +dashedName: step-56 --- # --description-- @@ -202,79 +202,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f039dbcef7673e4e758fa3.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f039dbcef7673e4e758fa3.md index cd036d5f29c..d571e15ddac 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f039dbcef7673e4e758fa3.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f039dbcef7673e4e758fa3.md @@ -1,8 +1,8 @@ --- id: 63f039dbcef7673e4e758fa3 -title: Step 56 +title: Step 57 challengeType: 0 -dashedName: step-56 +dashedName: step-57 --- # --description-- @@ -207,79 +207,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03a7143a6ef3f7f3344f0.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03a7143a6ef3f7f3344f0.md index abd6f9cd4c4..f4ad5a2be04 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03a7143a6ef3f7f3344f0.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03a7143a6ef3f7f3344f0.md @@ -1,8 +1,8 @@ --- id: 63f03a7143a6ef3f7f3344f0 -title: Step 57 +title: Step 58 challengeType: 0 -dashedName: step-57 +dashedName: step-58 --- # --description-- @@ -200,79 +200,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03ac2b428b2404a5a7518.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03ac2b428b2404a5a7518.md index ea8c957fded..b107b958be6 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03ac2b428b2404a5a7518.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03ac2b428b2404a5a7518.md @@ -1,8 +1,8 @@ --- id: 63f03ac2b428b2404a5a7518 -title: Step 58 +title: Step 59 challengeType: 0 -dashedName: step-58 +dashedName: step-59 --- # --description-- @@ -186,79 +186,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03af535682e4138fdb915.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03af535682e4138fdb915.md index ac04eadda26..cd1ce6646d7 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03af535682e4138fdb915.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03af535682e4138fdb915.md @@ -1,8 +1,8 @@ --- id: 63f03af535682e4138fdb915 -title: Step 59 +title: Step 60 challengeType: 0 -dashedName: step-59 +dashedName: step-60 --- # --description-- @@ -212,79 +212,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03b1ed5ab15420c057463.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03b1ed5ab15420c057463.md index fdfa5c08ceb..2a9951c34dd 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03b1ed5ab15420c057463.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f03b1ed5ab15420c057463.md @@ -1,8 +1,8 @@ --- id: 63f03b1ed5ab15420c057463 -title: Step 60 +title: Step 61 challengeType: 0 -dashedName: step-60 +dashedName: step-61 --- # --description-- @@ -204,79 +204,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( @@ -558,79 +507,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f6721d5110af243ef8f3d9.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f6721d5110af243ef8f3d9.md index b3680560533..9a356f291d1 100644 --- a/curriculum/challenges/english/blocks/workshop-shopping-cart/63f6721d5110af243ef8f3d9.md +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/63f6721d5110af243ef8f3d9.md @@ -1,8 +1,8 @@ --- id: 63f6721d5110af243ef8f3d9 -title: Step 53 +title: Step 54 challengeType: 0 -dashedName: step-53 +dashedName: step-54 --- # --description-- @@ -187,79 +187,28 @@ const cartTotal = document.getElementById("total"); const showHideCartSpan = document.getElementById("show-hide-cart"); let isCartShowing = false; +class Dessert { + constructor(id, name, price, category) { + this.id = id; + this.name = name; + this.price = price; + this.category = category; + } +} + const products = [ - { - id: 1, - name: "Vanilla Cupcakes (6 Pack)", - price: 12.99, - category: "Cupcake", - }, - { - id: 2, - name: "French Macaron", - price: 3.99, - category: "Macaron", - }, - { - id: 3, - name: "Pumpkin Cupcake", - price: 3.99, - category: "Cupcake", - }, - { - id: 4, - name: "Chocolate Cupcake", - price: 5.99, - category: "Cupcake", - }, - { - id: 5, - name: "Chocolate Pretzels (4 Pack)", - price: 10.99, - category: "Pretzel", - }, - { - id: 6, - name: "Strawberry Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 7, - name: "Chocolate Macarons (4 Pack)", - price: 9.99, - category: "Macaron", - }, - { - id: 8, - name: "Strawberry Pretzel", - price: 4.99, - category: "Pretzel", - }, - { - id: 9, - name: "Butter Pecan Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 10, - name: "Rocky Road Ice Cream", - price: 2.99, - category: "Ice Cream", - }, - { - id: 11, - name: "Vanilla Macarons (5 Pack)", - price: 11.99, - category: "Macaron", - }, - { - id: 12, - name: "Lemon Cupcakes (4 Pack)", - price: 12.99, - category: "Cupcake", - }, + new Dessert(1, "Vanilla Cupcakes (6 Pack)", 12.99, "Cupcake"), + new Dessert(2, "French Macaron", 3.99, "Macaron"), + new Dessert(3, "Pumpkin Cupcake", 3.99, "Cupcake"), + new Dessert(4, "Chocolate Cupcake", 5.99, "Cupcake"), + new Dessert(5, "Chocolate Pretzels (4 Pack)", 10.99, "Pretzel"), + new Dessert(6, "Strawberry Ice Cream", 2.99, "Ice Cream"), + new Dessert(7, "Chocolate Macarons (4 Pack)", 9.99, "Macaron"), + new Dessert(8, "Strawberry Pretzel", 4.99, "Pretzel"), + new Dessert(9, "Butter Pecan Ice Cream", 2.99, "Ice Cream"), + new Dessert(10, "Rocky Road Ice Cream", 2.99, "Ice Cream"), + new Dessert(11, "Vanilla Macarons (5 Pack)", 11.99, "Macaron"), + new Dessert(12, "Lemon Cupcakes (4 Pack)", 12.99, "Cupcake"), ]; products.forEach( diff --git a/curriculum/challenges/english/blocks/workshop-shopping-cart/69d7d4dc8c6e21a2a19c4d34.md b/curriculum/challenges/english/blocks/workshop-shopping-cart/69d7d4dc8c6e21a2a19c4d34.md new file mode 100644 index 00000000000..28d084410b0 --- /dev/null +++ b/curriculum/challenges/english/blocks/workshop-shopping-cart/69d7d4dc8c6e21a2a19c4d34.md @@ -0,0 +1,218 @@ +--- +id: 69d7d4dc8c6e21a2a19c4d34 +title: Step 6 +challengeType: 0 +dashedName: step-6 +--- + +# --description-- + +You are already familiar with an HTML `class`, but JavaScript also has a class. In JavaScript, a class is like a blueprint for creating objects. It allows you to define a set of properties and methods, and instantiate (or create) new objects with those properties and methods. + +Here is an example of declaring a `Dessert` class: + +```js +class Dessert {} +``` + +Before you start adding products, create a `class` named `Dessert`. Give it a `constructor` that takes four parameters in this order: `id`, `name`, `price`, and `category`. Inside the `constructor`, assign each parameter to a property of the same name on `this`. + +# --hints-- + +You should declare a class named `Dessert`. + +```js +assert.isFunction(Dessert); +``` + +Your `Dessert` class should have a `constructor` that takes four parameters: `id`, `name`, `price`, and `category`. + +```js +assert.strictEqual(Dessert.length, 4); +``` + +Your `Dessert` constructor should assign each parameter to a property of the same name on `this`. + +```js +const d = new Dessert(1, 'Test', 1.99, 'Test Category'); +assert.strictEqual(d.id, 1); +assert.strictEqual(d.name, 'Test'); +assert.strictEqual(d.price, 1.99); +assert.strictEqual(d.category, 'Test Category'); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + + + + + freeCodeCamp Shopping Cart + + + +
+

Desserts Page

+
+
+ +
+ +
+

Total number of items: 0

+

Subtotal: $0

+

Taxes: $0

+

Total: $0

+
+
+
+ + + +``` + +```css +*, +*::before, +*::after { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +:root { + --dark-grey: #1b1b32; + --light-grey: #f5f6f7; + --black: #000; + --white: #fff; + --grey: #3b3b4f; + --golden-yellow: #fecc4c; + --yellow: #ffcc4c; + --gold: #feac32; + --orange: #ffac33; + --dark-orange: #f89808; +} + +body { + background-color: var(--dark-grey); +} + +.title { + color: var(--light-grey); + text-align: center; + margin: 25px 0; +} + +#dessert-card-container { + display: flex; + flex-direction: column; + flex-wrap: wrap; + align-items: center; +} + +.dessert-card { + background-color: var(--light-grey); + padding: 15px; + text-align: center; + border-radius: 15px; + margin: 20px 10px; +} + +.dessert-price { + font-size: 1.2rem; +} + +.btn { + display: block; + cursor: pointer; + width: 100px; + color: var(--dark-grey); + background-color: var(--gold); + background-image: linear-gradient(var(--golden-yellow), var(--orange)); + border-color: var(--gold); + border-width: 3px; +} + +.btn:hover { + background-image: linear-gradient(var(--yellow), var(--dark-orange)); +} + +#cart-btn { + position: absolute; + top: 0; + right: 0; +} + +.add-to-cart-btn { + margin: 30px auto 10px; +} + +#cart-container { + display: none; + position: absolute; + top: 60px; + right: 0; + background-color: var(--light-grey); + width: 200px; + height: 400px; + border: 8px double var(--black); + border-radius: 15px; + text-align: center; + font-size: 1.2rem; + overflow-y: scroll; +} + +.product { + margin: 25px 0; +} + +.product-count { + display: inline-block; + margin-right: 10px; +} + +.product-category { + margin: 10px 0; +} + +@media (min-width: 768px) { + #dessert-card-container { + flex-direction: row; + } + + .dessert-card { + flex: 1 0 21%; + } + + #cart-container { + width: 300px; + } +} +``` + +```js +const cartContainer = document.getElementById("cart-container"); +const productsContainer = document.getElementById("products-container"); +const dessertCards = document.getElementById("dessert-card-container"); +const cartBtn = document.getElementById("cart-btn"); +const clearCartBtn = document.getElementById("clear-cart-btn"); +const totalNumberOfItems = document.getElementById("total-items"); +const cartSubTotal = document.getElementById("subtotal"); +const cartTaxes = document.getElementById("taxes"); +const cartTotal = document.getElementById("total"); +const showHideCartSpan = document.getElementById("show-hide-cart"); +let isCartShowing = false; + +--fcc-editable-region-- + +--fcc-editable-region-- + +const products = []; +``` diff --git a/curriculum/structure/blocks/workshop-shopping-cart.json b/curriculum/structure/blocks/workshop-shopping-cart.json index 75b302c9e6e..7326d74d0a1 100644 --- a/curriculum/structure/blocks/workshop-shopping-cart.json +++ b/curriculum/structure/blocks/workshop-shopping-cart.json @@ -6,246 +6,67 @@ "hasEditableBoundaries": true, "dashedName": "workshop-shopping-cart", "challengeOrder": [ - { - "id": "63ec14d1c216aa063f0be4af", - "title": "Step 1" - }, - { - "id": "63ec19978a066607e23439f8", - "title": "Step 2" - }, - { - "id": "63ec1a16f930b108b8a76806", - "title": "Step 3" - }, - { - "id": "63ec1bbf5584390a7d08d41f", - "title": "Step 4" - }, - { - "id": "63ec1cb59f2a4c0be5b6dfa0", - "title": "Step 5" - }, - { - "id": "63ec20a06fff670d37befbd9", - "title": "Step 6" - }, - { - "id": "63ec3287b182ec0efe8a3135", - "title": "Step 7" - }, - { - "id": "63ec3427fc3e9214c9ed2a14", - "title": "Step 8" - }, - { - "id": "63ec36f6133df7160be3ec66", - "title": "Step 9" - }, - { - "id": "63ec47b454495519739486a7", - "title": "Step 10" - }, - { - "id": "63ee5d38a5d29d0696f8d820", - "title": "Step 11" - }, - { - "id": "63ee5d8f9e7168076e932fe2", - "title": "Step 12" - }, - { - "id": "63ee5e0f08e82208364c4128", - "title": "Step 13" - }, - { - "id": "63ee5ea8be892e0955ab346c", - "title": "Step 14" - }, - { - "id": "63ee5fc113bcb20a5db9214b", - "title": "Step 15" - }, - { - "id": "63ee611d478dca0b77f6a393", - "title": "Step 16" - }, - { - "id": "63ee7c664f9b65137d925c8a", - "title": "Step 17" - }, - { - "id": "63eea5cea403a81a68ae493c", - "title": "Step 18" - }, - { - "id": "63eea817673c8e1c22927fa6", - "title": "Step 19" - }, - { - "id": "63eea8e1e143ae1d098c8c9d", - "title": "Step 20" - }, - { - "id": "63eeb8e86becbf1e75c2cb0d", - "title": "Step 21" - }, - { - "id": "63eedebb0ec0231ff1cede1a", - "title": "Step 22" - }, - { - "id": "63efdbc22a0c56070beabed7", - "title": "Step 23" - }, - { - "id": "63efe370bbfc4a08d500118e", - "title": "Step 24" - }, - { - "id": "63eff02f00e69a0b2ac10b43", - "title": "Step 25" - }, - { - "id": "63eff98ffb1d5a0d24ec79cb", - "title": "Step 26" - }, - { - "id": "63effe558c87a70e7072e447", - "title": "Step 27" - }, - { - "id": "63f0165121a9181342d5bc66", - "title": "Step 28" - }, - { - "id": "63f017b4ad028a148eb713c0", - "title": "Step 29" - }, - { - "id": "63f01861f813e01564c95315", - "title": "Step 30" - }, - { - "id": "63f018f04e487e164dc27bd9", - "title": "Step 31" - }, - { - "id": "63f01c9791a0aa1751c73760", - "title": "Step 32" - }, - { - "id": "63f0224ceb16dc196d2c860a", - "title": "Step 33" - }, - { - "id": "63f026d041bc6c1a3d5cba0f", - "title": "Step 34" - }, - { - "id": "63f0284532742c1b26c7a052", - "title": "Step 35" - }, - { - "id": "63f0289df84a581bbdbd29b7", - "title": "Step 36" - }, - { - "id": "63f033fdb1fbcc254999fcc3", - "title": "Step 37" - }, - { - "id": "63f03446c2ed3e264be6c7fc", - "title": "Step 38" - }, - { - "id": "63f0348a54a177272071a595", - "title": "Step 39" - }, - { - "id": "63f034d012f74627ce538d3a", - "title": "Step 40" - }, - { - "id": "63f0295e673b661ccb299e8a", - "title": "Step 41" - }, - { - "id": "63f029b96b9e9e1df93be951", - "title": "Step 42" - }, - { - "id": "63f02a4ef92d711ec1ff618c", - "title": "Step 43" - }, - { - "id": "63f02b22cce1c11fe9604381", - "title": "Step 44" - }, - { - "id": "63f02bdeb9b428208b97eb6b", - "title": "Step 45" - }, - { - "id": "63f02c6e18773921ba50aa53", - "title": "Step 46" - }, - { - "id": "63f0311f5ea9382388d6124f", - "title": "Step 47" - }, - { - "id": "63f03686c5ea863533ec71f4", - "title": "Step 48" - }, - { - "id": "63f036ec91fdf238c90665f5", - "title": "Step 49" - }, - { - "id": "63f0370b340915399d31e5eb", - "title": "Step 50" - }, - { - "id": "63f0374d5351223a747c301d", - "title": "Step 51" - }, - { - "id": "63f0378e173e3c3b7638b528", - "title": "Step 52" - }, - { - "id": "63f6721d5110af243ef8f3d9", - "title": "Step 53" - }, - { - "id": "63f038a0ae041d3c5b0cdf23", - "title": "Step 54" - }, - { - "id": "63f038e671d3f73d5a041973", - "title": "Step 55" - }, - { - "id": "63f039dbcef7673e4e758fa3", - "title": "Step 56" - }, - { - "id": "63f03a7143a6ef3f7f3344f0", - "title": "Step 57" - }, - { - "id": "63f03ac2b428b2404a5a7518", - "title": "Step 58" - }, - { - "id": "63f03af535682e4138fdb915", - "title": "Step 59" - }, - { - "id": "63f03b1ed5ab15420c057463", - "title": "Step 60" - } + { "id": "63ec14d1c216aa063f0be4af", "title": "Step 1" }, + { "id": "63ec19978a066607e23439f8", "title": "Step 2" }, + { "id": "63ec1a16f930b108b8a76806", "title": "Step 3" }, + { "id": "63ec1bbf5584390a7d08d41f", "title": "Step 4" }, + { "id": "63ec1cb59f2a4c0be5b6dfa0", "title": "Step 5" }, + { "id": "69d7d4dc8c6e21a2a19c4d34", "title": "Step 6" }, + { "id": "63ec20a06fff670d37befbd9", "title": "Step 7" }, + { "id": "63ec3287b182ec0efe8a3135", "title": "Step 8" }, + { "id": "63ec3427fc3e9214c9ed2a14", "title": "Step 9" }, + { "id": "63ec36f6133df7160be3ec66", "title": "Step 10" }, + { "id": "63ec47b454495519739486a7", "title": "Step 11" }, + { "id": "63ee5d38a5d29d0696f8d820", "title": "Step 12" }, + { "id": "63ee5d8f9e7168076e932fe2", "title": "Step 13" }, + { "id": "63ee5e0f08e82208364c4128", "title": "Step 14" }, + { "id": "63ee5ea8be892e0955ab346c", "title": "Step 15" }, + { "id": "63ee5fc113bcb20a5db9214b", "title": "Step 16" }, + { "id": "63ee611d478dca0b77f6a393", "title": "Step 17" }, + { "id": "63ee7c664f9b65137d925c8a", "title": "Step 18" }, + { "id": "63eea5cea403a81a68ae493c", "title": "Step 19" }, + { "id": "63eea817673c8e1c22927fa6", "title": "Step 20" }, + { "id": "63eea8e1e143ae1d098c8c9d", "title": "Step 21" }, + { "id": "63eeb8e86becbf1e75c2cb0d", "title": "Step 22" }, + { "id": "63eedebb0ec0231ff1cede1a", "title": "Step 23" }, + { "id": "63efdbc22a0c56070beabed7", "title": "Step 24" }, + { "id": "63efe370bbfc4a08d500118e", "title": "Step 25" }, + { "id": "63eff02f00e69a0b2ac10b43", "title": "Step 26" }, + { "id": "63eff98ffb1d5a0d24ec79cb", "title": "Step 27" }, + { "id": "63effe558c87a70e7072e447", "title": "Step 28" }, + { "id": "63f0165121a9181342d5bc66", "title": "Step 29" }, + { "id": "63f017b4ad028a148eb713c0", "title": "Step 30" }, + { "id": "63f01861f813e01564c95315", "title": "Step 31" }, + { "id": "63f018f04e487e164dc27bd9", "title": "Step 32" }, + { "id": "63f01c9791a0aa1751c73760", "title": "Step 33" }, + { "id": "63f0224ceb16dc196d2c860a", "title": "Step 34" }, + { "id": "63f026d041bc6c1a3d5cba0f", "title": "Step 35" }, + { "id": "63f0284532742c1b26c7a052", "title": "Step 36" }, + { "id": "63f0289df84a581bbdbd29b7", "title": "Step 37" }, + { "id": "63f033fdb1fbcc254999fcc3", "title": "Step 38" }, + { "id": "63f03446c2ed3e264be6c7fc", "title": "Step 39" }, + { "id": "63f0348a54a177272071a595", "title": "Step 40" }, + { "id": "63f034d012f74627ce538d3a", "title": "Step 41" }, + { "id": "63f0295e673b661ccb299e8a", "title": "Step 42" }, + { "id": "63f029b96b9e9e1df93be951", "title": "Step 43" }, + { "id": "63f02a4ef92d711ec1ff618c", "title": "Step 44" }, + { "id": "63f02b22cce1c11fe9604381", "title": "Step 45" }, + { "id": "63f02bdeb9b428208b97eb6b", "title": "Step 46" }, + { "id": "63f02c6e18773921ba50aa53", "title": "Step 47" }, + { "id": "63f0311f5ea9382388d6124f", "title": "Step 48" }, + { "id": "63f03686c5ea863533ec71f4", "title": "Step 49" }, + { "id": "63f036ec91fdf238c90665f5", "title": "Step 50" }, + { "id": "63f0370b340915399d31e5eb", "title": "Step 51" }, + { "id": "63f0374d5351223a747c301d", "title": "Step 52" }, + { "id": "63f0378e173e3c3b7638b528", "title": "Step 53" }, + { "id": "63f6721d5110af243ef8f3d9", "title": "Step 54" }, + { "id": "63f038a0ae041d3c5b0cdf23", "title": "Step 55" }, + { "id": "63f038e671d3f73d5a041973", "title": "Step 56" }, + { "id": "63f039dbcef7673e4e758fa3", "title": "Step 57" }, + { "id": "63f03a7143a6ef3f7f3344f0", "title": "Step 58" }, + { "id": "63f03ac2b428b2404a5a7518", "title": "Step 59" }, + { "id": "63f03af535682e4138fdb915", "title": "Step 60" }, + { "id": "63f03b1ed5ab15420c057463", "title": "Step 61" } ], "helpCategory": "JavaScript" }