Skip to content

Commit de40d9d

Browse files
complete count.js exercise
1 parent 124ae45 commit de40d9d

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

Prep/area_perimeter.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const height = 10; // 10 is just an example of a value here - your code should still work if you change this to another value.
2+
const width = 30; // Also just an example - your code should still work if this changes.
3+
4+
const area = height * width;
5+
const perimeter = 2 * (height + width);
6+
7+
console.log("Area:", area, "Perimeter:", perimeter);

Prep/example.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const yearOfBirth = 1990; // declaration
2+
let currentYear = 2023; // declaration
3+
4+
currentYear++; // statement
5+
6+
console.log(`I am ${currentYear - yearOfBirth} years old`);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ 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+
// Line 3 reassigns the value of the variable count. For this, the assignment operator = is used. The new value of count will be an expression of count + 1.

0 commit comments

Comments
 (0)