Skip to content

Commit b975ffa

Browse files
committed
Initial commit
1 parent 8f3d6cf commit b975ffa

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Sprint-1/1-key-exercises/1-count.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ count = count + 1;
44

55
// Line 1 is a variable declaration, creating the count variable with an initial value of 0
66
// Describe what line 3 is doing, in particular focus on what = is doing
7+
8+
// Line 3 is updating the value of the count variable by adding 1 to its current value. The = operator is an assignment operator that assigns the result of the expression on the right (count + 1) to the variable on the left (count).
9+
// So after line 3 executes, count will have a new value of 1.
10+
// = does not mean “equal to” (as in math); it means “take the value on the right and store it in the variable on the left.”

prep/prep-sprint-1.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// 1.Write a function that will calculate the area of a rectangle. The function should take two parameters: length and width. It should return the area of the rectangle.
2+
3+
function calculateArea(length, width) {
4+
const area = length * width;
5+
return area;
6+
}
7+
8+
console.log(calculateArea(3, 4)); // Output: 12
9+
10+
// 2.Write a function that will capitalize the first letter in a given string.
11+
12+
function capitalizeFirstLetter(name) {
13+
const result = name[0].toUpperCase() + name.slice(1);
14+
return result;
15+
}
16+
17+
console.log(capitalizeFirstLetter("mario")); // Output: "Mario"

0 commit comments

Comments
 (0)