Repository navigation
Cape Town | sep-2026-itp | Matthaus Bause | Sprint 2| Complete Sprint 2 courswork - #1528
chefmatthaus-hub wants to merge 45 commits into
Conversation
…hanges the value of variable. Also declared a variable called initials to store the first characters of each string
… before console.log
| @@ -1,9 +1,13 @@ | |||
| const cardNumber = 4533787178994213; | |||
| const cardNumber = "4533787178994213"; | |||
There was a problem hiding this comment.
Could you have another look at which part of this the exercise asks you to update?
There was a problem hiding this comment.
Was I suppose to convert the number into a string?
const last4Digits = String(cardeNumber).slice(-4);
There was a problem hiding this comment.
Exactly. The task mentioned "Then try updating the expression last4Digits is assigned to"
const last4Digits = cardNumber.slice(-4);
In this case the line is a variable declaration statement, where we assign expression cardNumber.slice(-4) to a variable last4Digits.
| @@ -1,5 +1,7 @@ | |||
| // Currently trying to print the string "I was born in Bolton" but it isn't working... | |||
| // what's the error ? | |||
| // Answer: because javascript runs from top to bottom, by declaring the const after running console.log the function throws an error because the decleration is done ater console.log | |||
There was a problem hiding this comment.
Did you manage to note the exact error that happened here in the original file?
There was a problem hiding this comment.
Terminals throws a Reference error
| Answer: this stores all the functions that the console has. | ||
|
|
||
| What does the syntax `console.log` or `console.assert` mean? In particular, what does the `.` mean? | ||
| Answer: 'console' is an object and 'log/assert' is properties of log. the `.` is going to look-up which property is stored in the object |
There was a problem hiding this comment.
Properties of log or of something else?
There was a problem hiding this comment.
Oh shoot!
'.' is an object that accesses the properties of an object
|
Nice @chefmatthaus-hub! Few issues need addressing but overall a very solid submission, and good job on doing the stretch tasks! |
|
Thanks for the feedback, if you don't mind pointing them out, I would like to see what I can work on and if needed, book a mentoring session to address them. |
|
Will have a look tomorrow! |
|
@chefmatthaus-hub if you could please add the fixes discussed in the comments, I'd take another look. |
LonMcGregor
left a comment
There was a problem hiding this comment.
This looks complete now. Good work
Self checklist
CYF-1039
learning to understand the fundamentals of JavaScript.