Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Challenges Documentation Updates #22

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions 01-basic-challenges-1/10-remove-duplicates/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<string | boolean | number>} arr - The array to remove duplicates from.
* @returns {Array<string | boolean | number>[]} - The new array with duplicates removed.
*/
function removeDuplicates(arr: any[]): any[];
function removeDuplicates(arr: Array<string | boolean | number>): Array<string | boolean | number>;
```

### Examples
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions 02-basic-challenges-2/01-fizzbuzz-array/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<string | number>} - The array of strings or numbers.
*/
function fizzBuzzArray(num: number): any[];
function fizzBuzzArray(num: number): Array<string | number>;
```

### Examples
Expand Down
Original file line number Diff line number Diff line change
@@ -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
)
Expand All @@ -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
)
Expand Down