From 8f0fe8f9c98629102b13f5a315caefd324b8308e Mon Sep 17 00:00:00 2001 From: rlking1985 Date: Mon, 1 Jan 2024 14:21:51 +1100 Subject: [PATCH 1/4] 10-remove-duplicates readme changed to allow specific data types as arrays/objects will cause tests to fail --- 01-basic-challenges-1/10-remove-duplicates/readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/01-basic-challenges-1/10-remove-duplicates/readme.md b/01-basic-challenges-1/10-remove-duplicates/readme.md index ced1eae3..530ddeba 100644 --- a/01-basic-challenges-1/10-remove-duplicates/readme.md +++ b/01-basic-challenges-1/10-remove-duplicates/readme.md @@ -9,10 +9,10 @@ Write a function called `removeDuplicates` that takes in an array and returns a ```js /** * Returns a new array with duplicates removed. - * @param {any[]} arr - The array to remove duplicates from. - * @returns {any[]} - The new array with duplicates removed. + * @param {Array} arr - The array to remove duplicates from. + * @returns {Array[]} - The new array with duplicates removed. */ -function removeDuplicates(arr: any[]): any[]; +function removeDuplicates(arr: Array): Array; ``` ### Examples @@ -25,7 +25,7 @@ removeDuplicates([1, 2, 3, 4, 5, true, 1, 'hello' 2, 3, 'hello', true]); // [1, ### Constraints -- The array can contain any data type +- The array can contain strings, numbers or boolean data types. ### Hints From ddc0f2e39c3283abb2bb5e6157be9644c7d6692d Mon Sep 17 00:00:00 2001 From: rlking1985 Date: Mon, 1 Jan 2024 14:23:45 +1100 Subject: [PATCH 2/4] 01-fizzbuzz-array changed the readme function return type to be an array of strings or numbers --- 02-basic-challenges-2/01-fizzbuzz-array/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/02-basic-challenges-2/01-fizzbuzz-array/readme.md b/02-basic-challenges-2/01-fizzbuzz-array/readme.md index b9ffb155..9a226773 100644 --- a/02-basic-challenges-2/01-fizzbuzz-array/readme.md +++ b/02-basic-challenges-2/01-fizzbuzz-array/readme.md @@ -14,9 +14,9 @@ In this challenge, you will write a function called `fizzBuzzArray` that takes i /** * Returns an array of numbers from 1 to the number passed in. * @param {number} num - The number to loop up to. - * @returns {any[]} - The array of numbers. + * @returns {Array} - The array of numbers. */ -function fizzBuzzArray(num: number): any[]; +function fizzBuzzArray(num: number): Array; ``` ### Examples From 9aa25ac363e74da7a5b384fa3dc655c9c491e743 Mon Sep 17 00:00:00 2001 From: rlking1985 Date: Mon, 1 Jan 2024 14:26:33 +1100 Subject: [PATCH 3/4] 01-fizzbuzz-array changed the readme function return type to be an array of strings or numbers --- 02-basic-challenges-2/01-fizzbuzz-array/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/02-basic-challenges-2/01-fizzbuzz-array/readme.md b/02-basic-challenges-2/01-fizzbuzz-array/readme.md index 9a226773..2215e456 100644 --- a/02-basic-challenges-2/01-fizzbuzz-array/readme.md +++ b/02-basic-challenges-2/01-fizzbuzz-array/readme.md @@ -14,7 +14,7 @@ In this challenge, you will write a function called `fizzBuzzArray` that takes i /** * Returns an array of numbers from 1 to the number passed in. * @param {number} num - The number to loop up to. - * @returns {Array} - The array of numbers. + * @returns {Array} - The array of strings or numbers. */ function fizzBuzzArray(num: number): Array; ``` From 1b157f44b4efadf667b0891839e8532377f62a02 Mon Sep 17 00:00:00 2001 From: rlking1985 Date: Tue, 9 Jan 2024 11:56:54 +1100 Subject: [PATCH 4/4] Removed .js from test --- .../calculate-total-sales-test.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/03-high-order-array-methods/03-calculate-total-sales/calculate-total-sales-test.js b/03-high-order-array-methods/03-calculate-total-sales/calculate-total-sales-test.js index d1f58678..6a723661 100644 --- a/03-high-order-array-methods/03-calculate-total-sales/calculate-total-sales-test.js +++ b/03-high-order-array-methods/03-calculate-total-sales/calculate-total-sales-test.js @@ -1,12 +1,12 @@ -const calculateTotalSalesWithTax = require('./calculate-total-sales.js'); +const calculateTotalSalesWithTax = require("./calculate-total-sales"); -test('Calculating total sales amount with tax', () => { +test("Calculating total sales amount with tax", () => { expect( calculateTotalSalesWithTax( [ - { name: 'Apple', price: 0.5, quantity: 10 }, - { name: 'Banana', price: 0.3, quantity: 20 }, - { name: 'Orange', price: 0.6, quantity: 15 }, + { name: "Apple", price: 0.5, quantity: 10 }, + { name: "Banana", price: 0.3, quantity: 20 }, + { name: "Orange", price: 0.6, quantity: 15 }, ], 8 ) @@ -15,10 +15,10 @@ test('Calculating total sales amount with tax', () => { expect( calculateTotalSalesWithTax( [ - { name: 'Chocolate', price: 2.5, quantity: 5 }, - { name: 'Chips', price: 1.2, quantity: 10 }, - { name: 'Soda', price: 1.0, quantity: 8 }, - { name: 'Candy', price: 0.5, quantity: 15 }, + { name: "Chocolate", price: 2.5, quantity: 5 }, + { name: "Chips", price: 1.2, quantity: 10 }, + { name: "Soda", price: 1.0, quantity: 8 }, + { name: "Candy", price: 0.5, quantity: 15 }, ], 5 )