-
-
Notifications
You must be signed in to change notification settings - Fork 117
LONDON_JAN25 | KHALIL ALI | STRUCTURING_AND_TESTING_DATA | SPRINT 1 | WEEK 4 #446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the descriptions are not quite correct. Can you improve them?
const dir = ; | ||
const ext = ; | ||
const dir = filePath.slice(0, lastSlashIndex) | ||
const ext = filePath.slice(lastSlashIndex + 5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you modify your approach for extracting the file extension so that it can work for "name" and the "extension" of any length? For example, index.html
, 3-paths.js
.
|
||
console.log("num value is :", num) | ||
/* | ||
Math.random():returns a random number between n = [ 0 , 1 [ . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The typical interval notation to represent 0 to 1, including 0 but excluding 1 is, [0, 1)
.
console.log("num value is :", num) | ||
/* | ||
Math.random():returns a random number between n = [ 0 , 1 [ . | ||
Math.floor() :returns the previous real number of a decimal number . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description does not make much sense.
For example, 3.14 is also a real number.
Can you rephrase it, or ask ChatGPT or looking the MDN reference of Math.floor()
?
const cardNumber = "4533787178994213"; | ||
const last4Digits = cardNumber.slice(-4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use an approach that does not involve replacing the original value?
const hourClockTime12 = "08:53"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why start one variable name in lowercase letter and the other one with uppercase letter?
@@ -20,3 +20,9 @@ console.log(`The percentage change is ${percentageChange}`); | |||
// d) Identify all the lines that are variable declarations | |||
|
|||
// e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression? | |||
|
|||
// a) 3 times . lines (4,5,10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are more than 3 function calls. Can you identify all of them?
// b) line 5 . syntax error in replaceAll function. add comma | ||
// c) 4 , 5 lines | ||
// d) 1 , 2 , 7 , 8 lines | ||
// e) replace each "," in carPrice with nothing which means : delete each comma |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only described the priceAfterOneYear.replaceAll("," ,"")
part of the expression, and not the whole expression.
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.