Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
72a2114
add comment explaining what like 3 is doing
vmoratti Jun 10, 2026
e988493
use string indexing to get the initials
vmoratti Jun 10, 2026
541c57c
figure out what (num) represents, add comment
vmoratti Jun 12, 2026
2c05e7e
solve the slicing proble,create dir variabe and ext variable
vmoratti Jun 12, 2026
0a2e2ac
answer the question in the exercse
vmoratti Jun 12, 2026
697ddfc
change const to let, add comment
vmoratti Jun 12, 2026
704b717
fix the error, comment on it
vmoratti Jun 12, 2026
4c49b91
add question in comments
vmoratti Jun 13, 2026
6003611
fix problem
vmoratti Jun 14, 2026
06ed7a8
answer all the questions in the exercise
vmoratti Jun 14, 2026
a6d738a
Answer questions in the exercise
vmoratti Jun 15, 2026
c00ebcd
add comments to explain code
vmoratti Jun 15, 2026
c89d0c3
can't undestand instructions
vmoratti Jun 15, 2026
c1f0514
answer questions in objects.md
vmoratti Jun 15, 2026
71235b3
solve the code error message
vmoratti Jun 24, 2026
fa98548
fix proble, answer questions
vmoratti Jun 25, 2026
4b743c8
fix code, explain fix
vmoratti Jun 25, 2026
4919640
fix code, write explanation
vmoratti Jun 25, 2026
6a9bf82
explain and fix code
vmoratti Jun 25, 2026
9560e8d
explain and fix the code
vmoratti Jun 25, 2026
6187040
create function to calculate BMI
vmoratti Jun 25, 2026
82a2abd
implement function for UPPER_SNAKE
vmoratti Jun 25, 2026
ca2e82e
implement function to convert to pounds
vmoratti Jun 26, 2026
c81c5df
Answer questions
vmoratti Jun 28, 2026
301c8f1
write tests, fix bugs
vmoratti Jun 29, 2026
9ccd193
edit comment
vmoratti Jun 30, 2026
3a491f5
Delete Sprint-1/1-key-exercises/1-count.js
vmoratti Jun 30, 2026
9c5bcd0
Delete Sprint-1/4-stretch-explore/objects.md
vmoratti Jun 30, 2026
eb98abb
Delete Sprint-1/4-stretch-explore/chrome.md
vmoratti Jun 30, 2026
2d44b64
Delete Sprint-1/2-mandatory-errors/2.js
vmoratti Jun 30, 2026
ce208ae
Delete Sprint-1/2-mandatory-errors/4.js
vmoratti Jun 30, 2026
e042ab7
Delete Sprint-1/1-key-exercises/2-initials.js
vmoratti Jun 30, 2026
19f6b35
Delete Sprint-1/1-key-exercises/3-paths.js
vmoratti Jun 30, 2026
2c2aeee
Delete Sprint-1/1-key-exercises/4-random.js
vmoratti Jun 30, 2026
d43c9fa
Delete Sprint-1/2-mandatory-errors/1.js
vmoratti Jun 30, 2026
b68e8ad
Delete Sprint-1/2-mandatory-errors/0.js
vmoratti Jun 30, 2026
712fb63
Delete Sprint-1/2-mandatory-errors/3.js
vmoratti Jun 30, 2026
c10a299
Delete Sprint-1/3-mandatory-interpret/1-percentage-change.js
vmoratti Jun 30, 2026
5a6b4c4
Delete Sprint-1/3-mandatory-interpret/2-time-format.js
vmoratti Jun 30, 2026
8ccb9f5
Delete Sprint-1/3-mandatory-interpret/3-to-pounds.js
vmoratti Jun 30, 2026
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
6 changes: 0 additions & 6 deletions Sprint-1/1-key-exercises/1-count.js

This file was deleted.

11 changes: 0 additions & 11 deletions Sprint-1/1-key-exercises/2-initials.js

This file was deleted.

23 changes: 0 additions & 23 deletions Sprint-1/1-key-exercises/3-paths.js

This file was deleted.

9 changes: 0 additions & 9 deletions Sprint-1/1-key-exercises/4-random.js

This file was deleted.

2 changes: 0 additions & 2 deletions Sprint-1/2-mandatory-errors/0.js

This file was deleted.

4 changes: 0 additions & 4 deletions Sprint-1/2-mandatory-errors/1.js

This file was deleted.

5 changes: 0 additions & 5 deletions Sprint-1/2-mandatory-errors/2.js

This file was deleted.

9 changes: 0 additions & 9 deletions Sprint-1/2-mandatory-errors/3.js

This file was deleted.

2 changes: 0 additions & 2 deletions Sprint-1/2-mandatory-errors/4.js

This file was deleted.

22 changes: 0 additions & 22 deletions Sprint-1/3-mandatory-interpret/1-percentage-change.js

This file was deleted.

25 changes: 0 additions & 25 deletions Sprint-1/3-mandatory-interpret/2-time-format.js

This file was deleted.

27 changes: 0 additions & 27 deletions Sprint-1/3-mandatory-interpret/3-to-pounds.js

This file was deleted.

18 changes: 0 additions & 18 deletions Sprint-1/4-stretch-explore/chrome.md

This file was deleted.

16 changes: 0 additions & 16 deletions Sprint-1/4-stretch-explore/objects.md

This file was deleted.

14 changes: 12 additions & 2 deletions Sprint-2/1-key-errors/0.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Predict and explain first...
// =============> write your prediction here

// call the function capitalise with a string input
// Well, I think the variable "str" is being declared twice, so the code will
// through an error message.
//
//call the function capitalise with a string input
// interpret the error message and figure out why an error is occurring

function capitalise(str) {
Expand All @@ -10,4 +12,12 @@ function capitalise(str) {
}

// =============> write your explanation here
//The variable "str" has been used as a parameter for the capitalise function
//and also been declared again inside the function. I think if "let" is removed
//the code will work.
// =============> write your new code here
function capitalise(str) {
str = `${str[0].toUpperCase()}${str.slice(1)}`;
return str;
}
console.log(capitalise("sorted"));
28 changes: 24 additions & 4 deletions Sprint-2/1-key-errors/1.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,40 @@
// Predict and explain first...

// Why will an error occur when this program runs?
// =============> write your prediction here

// I think there will be an error as "decimalNumber" variable has already been declared as a parameter in
// "convertToPercentage" function
//
// Try playing computer with the example to work out what is going on

function convertToPercentage(decimalNumber) {
/*function convertToPercentage(decimalNumber) {
const decimalNumber = 0.5;
const percentage = `${decimalNumber * 100}%`;

return percentage;
}

console.log(decimalNumber);
console.log(decimalNumber); */

// =============> write your explanation here
// =============Explanation ===============
// the "decimalNumber" variable is a local variable and can only be seen inside "convertToPercentage" function
// therefore when called outside the function it triggers "ReferenceError"

// Finally, correct the code to fix the problem
// =========correction=========
// problem can be fixed by moving the variable declaration outside the function
// and making it global

// =============> write your new code here

const decimalNumber = 0.5;
function convertToPercentage(decimalNumber) {
const percentage = `${decimalNumber * 100}%`;

return percentage;
}

console.log(decimalNumber);
console.log(convertToPercentage(decimalNumber));


22 changes: 13 additions & 9 deletions Sprint-2/1-key-errors/2.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@

// Predict and explain first BEFORE you run any code...

// this function should square any number but instead we're going to get an error

// =============> write your prediction of the error here

function square(3) {
//=========Prediction=============
// I think there will not be en error till we call the function.
/*function square(num) {
return num * num;
}

console.log(square(5))*/
// =============> write the error message here

// Unexpected number
// =============> explain this error message here

// I think it function expects parameter as a variable rather than a number.
// Finally, correct the code to fix the problem

// ===========correction=========
// to correct the code we need to introduce parameter as a variable, rather than a number.
// that way any number can be passed when function is called.
// =============> write your new code here


function square(num) {
return num * num;
}
console.log(square(5));
19 changes: 15 additions & 4 deletions Sprint-2/2-mandatory-debug/0.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
// Predict and explain first...

// =============> write your prediction here

function multiply(a, b) {
//===========Prediction=======
// I think the code will not produce the desired result as the function is not returning any value
/*function multiply(a, b) {
console.log(a * b);
}

console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
console.log(multiply(3, 5));
typeof(multiply(3, 4));*/

// =============> write your explanation here

//===============Explanation=========
// The function itself prints out the result, but the result has no (type) as such and can not be used as
// a data type.
//
// Finally, correct the code to fix the problem
//============correction============
// To correct the code "return" needs to be introduced.
// =============> write your new code here
function multiply(a, b) {
return (a * b);
}
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
14 changes: 12 additions & 2 deletions Sprint-2/2-mandatory-debug/1.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
// Predict and explain first...
// =============> write your prediction here

// =============explanation==========
// I think will either give error, or no result at all as there is a ";" semicolon after
// the return statement and the actual calculation is not assigned to anything.
function sum(a, b) {
return;
a + b;
a + b;
}

console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);

// =============> write your explanation here
//==============Explanation===============
//To fix the code the ";" must be removed, and the calculation
//needs to be placed next to the "return"
// Finally, correct the code to fix the problem
// =============> write your new code here
function sum(a, b) {
return a + b;
}

console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
22 changes: 22 additions & 0 deletions Sprint-2/2-mandatory-debug/2.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

// Predict the output of the following code:
// =============> Write your prediction here
//============Prediction========
// I think the code output will be "3" in al three cases as "num variable is declared outside the function and
// not used as a parameter for the function"

const num = 103;

Expand All @@ -14,11 +17,30 @@ console.log(`The last digit of 105 is ${getLastDigit(105)}`);
console.log(`The last digit of 806 is ${getLastDigit(806)}`);

// Now run the code and compare the output to your prediction
// prediction matched
// =============> write the output here
/*The last digit of 42 is 3
The last digit of 105 is 3
The last digit of 806 is 3*/
// Explain why the output is the way it is
// =============> write your explanation here
//===============Explanation===========
// The variable is not used as a parameter of the function, and therefore
// is ignored when passed inside function call.
// Finally, correct the code to fix the problem
//
// =============> write your new code here
//const num = 103;

function getLastDigit(num) {
return num.toString().slice(-1);
}

console.log(`The last digit of 42 is ${getLastDigit(42)}`);
console.log(`The last digit of 105 is ${getLastDigit(105)}`);
console.log(`The last digit of 806 is ${getLastDigit(806)}`);
// This program should tell the user the last digit of each number.
// Explain why getLastDigit is not working properly - correct the problem
// =============explanation==================
// The variable is not used as a parameter of the function, and therefore
// is ignored when passed inside function call.
Loading
Loading