You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sprint-1/1-key-exercises/1-count.js
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4,3 +4,7 @@ count = count + 1;
4
4
5
5
// Line 1 is a variable declaration, creating the count variable with an initial value of 0
6
6
// 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.”
// 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
+
functioncalculateArea(length,width){
4
+
constarea=length*width;
5
+
returnarea;
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.
0 commit comments