Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 4 additions & 2 deletions questions-and-reviews/questions/0.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ const result2 = logSum(10, 32);

a) what will `result1` evaluate to? Explain your answer

b) What will `result2` evaluate to? Explain your answer
b) What will `result2` evaluate to?

c) Try to summarise the main difference between `logSum` and `calculateSum`


{YOUR ANSWERS HERE}
a) result 1 will evaluate to 42. The function calculates sum will return the sum of the two arguments
b) it will return undefined because the function does not return anything but console.log the sum of the argument
c) logSum will only log the answer where as calculateSum will return the sum that can be reusable
4 changes: 2 additions & 2 deletions questions-and-reviews/questions/2.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
In this task, you'll need to look at some code and predict what it does, **before running the program**
This task will help you to develop your code reading skills.


Look at the code in `2.js`: read it carefully and discuss it with your pair.
What do you think the output will look like?
If some parts of the code are unfamiliar, then look them up on MDN.
Write your prediction below:

{YOUR PREDICTION HERE}
it will log to the console a star for each count. it will start with one star until it gets to 10 stars

Once you've written your prediction, then commit your work. Now actually run `2.js` using node and write your answer below:

{ACTUAL OBSERVED BEHAVIOUR}
{ACTUAL OBSERVED BEHAVIOUR}
4 changes: 3 additions & 1 deletion questions-and-reviews/questions/3.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Describe the difference between a commit and a push

{YOUR ANSWER HERE}
A commit in Git is a snapshot of your changes in a repository at a specific point in time

{YOUR ANSWER HERE}
A push in Git is the process of sending your committed changes from your local repository to a remote repository, such as GitHub
5 changes: 4 additions & 1 deletion questions-and-reviews/questions/4.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ Q: What is the difference between a fork and cloned repository?

A: {YOUR ANSWER HERE}

Remember to commit and push when you're finished!
fork
for collaboration as you create a service side copy of a repository on your account

Remember to commit and push when you're finished!
cloning is for local work, typically clone your fork to start contributing
18 changes: 7 additions & 11 deletions questions-and-reviews/questions/6.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@




function printTimesTables(n) {
const count = 1;
while(count <= 12) {
const product = n * i;
console.log(`${n} * ${i} = ${product}`);
count++;
}
let count = 1;
while (count <= 12) {
const product = n * count;
console.log(`${count} * ${n} = ${product}`);
count++;
}
}

printTimesTables(5);