Skip to content

Commit e9a3b83

Browse files
committed
resources
1 parent 37309ed commit e9a3b83

File tree

485 files changed

+21292
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

485 files changed

+21292
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
.DS_Store
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const helloWorld = require('./hello-world');
2+
3+
const result = helloWorld();
4+
5+
console.log(result);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function helloWorld() {
2+
// Return the string 'Hello World!'
3+
return 'Hello World!';
4+
}
5+
6+
module.exports = helloWorld;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const helloWorld = require('./hello-world');
2+
3+
test("Returning 'Hello, World!' as a string", () => {
4+
const result = helloWorld();
5+
expect(result).toBe('Hello World!');
6+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
function helloWorld() {}
2+
3+
module.exports = helloWorld;
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Challenge: Hello World Sample Challenge
2+
3+
This is a practice challenge to show you how things are set up and how to test, etc.
4+
5+
## Instructions
6+
7+
Write a function called `helloWorld` that returns a string of 'Hello World!'.
8+
9+
### Function Signature
10+
11+
```js
12+
/**
13+
* Returns a string containing 'Hello World!'.
14+
* @returns {string} - The string 'Hello World!'.
15+
*/
16+
function helloWorld(): string;
17+
```
18+
19+
### Examples
20+
21+
```JS
22+
helloWorld() // 'Hello World!'
23+
```
24+
25+
### Constraints
26+
27+
I will put any constraints here. They will vary depending on the challenge.
28+
29+
- The function must return a string
30+
31+
### Hints
32+
33+
- I will put a couple hints here. You can choose to use them or not.
34+
35+
## Solutions
36+
37+
<details>
38+
<summary>Click For Solution</summary>
39+
40+
```JS
41+
function printHelloWorld() {
42+
return 'Hello World!';
43+
}
44+
```
45+
46+
### Explanation
47+
48+
I will put the explanation to the solution here. The length and depth of the explanation will vary depending on the challenge.
49+
50+
</details>
51+
52+
### Test Cases
53+
54+
The Jest tests will go here. They are already included in the course files. You just need to run `npm test`. Sometimes I will also put manual tests here.
55+
56+
```JS
57+
test("Returning 'Hello, World!' as a string", () => {
58+
const result = helloWorld();
59+
expect(result).toBe('Hello World!');
60+
});
61+
```
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const getSum = require('./get-sum');
2+
3+
const result = getSum(1, 10);
4+
5+
console.log(result);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function getSum(a, b) {
2+
// return the sum of a and b
3+
return a + b;
4+
}
5+
6+
module.exports = getSum;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const getSum = require('./get-sum');
2+
3+
test('Calculating the sum of two numbers', () => {
4+
// Test case inputs
5+
const num1 = 5;
6+
const num2 = 7;
7+
8+
// Call the function
9+
const result = getSum(num1, num2);
10+
11+
// Check if the result is equal to the expected sum
12+
expect(result).toBe(12);
13+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
function getSum() {}
2+
3+
module.exports = getSum;

0 commit comments

Comments
 (0)