diff --git a/questions-and-reviews/questions/0.md b/questions-and-reviews/questions/0.md index ab3127d7..4ea7a9d2 100644 --- a/questions-and-reviews/questions/0.md +++ b/questions-and-reviews/questions/0.md @@ -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 diff --git a/questions-and-reviews/questions/2.md b/questions-and-reviews/questions/2.md index b9c7a189..a28a69bc 100644 --- a/questions-and-reviews/questions/2.md +++ b/questions-and-reviews/questions/2.md @@ -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} \ No newline at end of file +{ACTUAL OBSERVED BEHAVIOUR} diff --git a/questions-and-reviews/questions/3.md b/questions-and-reviews/questions/3.md index bc0764bc..33261bc0 100644 --- a/questions-and-reviews/questions/3.md +++ b/questions-and-reviews/questions/3.md @@ -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} \ No newline at end of file +A push in Git is the process of sending your committed changes from your local repository to a remote repository, such as GitHub diff --git a/questions-and-reviews/questions/4.md b/questions-and-reviews/questions/4.md index 8661825d..4df96114 100644 --- a/questions-and-reviews/questions/4.md +++ b/questions-and-reviews/questions/4.md @@ -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! \ No newline at end of file +cloning is for local work, typically clone your fork to start contributing diff --git a/questions-and-reviews/questions/6.js b/questions-and-reviews/questions/6.js index 090afe52..d65a3fa0 100644 --- a/questions-and-reviews/questions/6.js +++ b/questions-and-reviews/questions/6.js @@ -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);