Skip to content

Conversation

Nataliia74
Copy link

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with REGION | COHORT_NAME | FIRST_NAME LAST_NAME | PROJ_NAME
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@Nataliia74 Nataliia74 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 10, 2025
@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jun 20, 2025
Copy link
Author

@Nataliia74 Nataliia74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Operation like count = count + 1 is very common in programming, and there is a programming term describing such operation.

Can you find out what one-word programming term describes the operation on line 3?

Hello CJ Yuan
Yes, the operation count = count + 1 in programming is called incrementation. In this particular case by 1. The incrementation can be 2 types: - pre-incrementation and -post-incrementation. There are short versions: count++ or ++count. Which type to use depends on our coding. In for loops we mostly use post-incrementation.

Copy link
Author

@Nataliia74 Nataliia74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Phrases like "integer in range from 0 to 1" or "between 0 and 1" are not precise enough in a program specification, because they do not clearly state whether the endpoints 0 and 1 are included.

You can also use the concise and precise interval notation to describe a range of values.
For example, we can say, "Math.random() returns a random number in the interval [0, 1)"

So, interval notation is a much clearer and more precise way to express the range numbers by using () brackets to exclude defined numbers inside the parenthesis, and [] brackets - to include numbers.

Copy link
Author

@Nataliia74 Nataliia74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suppose you were not allowed to modify the statement const cardNumber = 4533787178994213;
(that is, keep the variable's value unchanged).
How would you modify the code (through type conversion) so that you can still use .slice(-4) to extract the last 4 digits from the given number.

I would use toString to convert the number value into a string to slice it on the further step.

@cjyuan
Copy link
Contributor

cjyuan commented Jun 21, 2025

Could you take this opportunity to respond to inline comments directly in their threads? It would make tracking responses easier.

Copy link
Author

@Nataliia74 Nataliia74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In JS naming convention, variable names usually begins with a lowercase letter. Names starting with an uppercase letter are used for built-in and custom data types (e.g., Math)

I see, that I omitted an important part. We should avoid more than using keywords, and numbers at the start of the variables' names, but also be careful to use a capital letter at the start of the variable name. Because the convention to begin a variable name with an uppercase emphasises that we indicate a special type of value, like an object or array. These are more complicated values.

Copy link
Author

@Nataliia74 Nataliia74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • You described two operations, which operation is carried out first?

  • We could also use the verb "remove" to describe what carPrice.replaceAll(",","")

So, first, we had the carPrice variable with the value "10,000", then we reassigned the variable by replacing coma with "" and transformed it to a number, and the value became 10000. Yes, it will be easier to use remove instead of replaceAll. I got it.

Copy link
Author

@Nataliia74 Nataliia74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Between formattedTime and formattingTime, which one do you think is better?

If it is a result, then formattedTime.

Copy link
Author

@Nataliia74 Nataliia74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we expect this program to work as intended for any valid penceString if we deleted .padEnd(2, "0") from the code?
In other words, do we really need .padEnd(2, "0") in this script?

No, I can't expect that the program is going to work properly without method .padEnd(2, "0"). As .padEnd(2, "0") allows us to get pence on the right format. Actually .padEnd(2, "0") control whether we get a value with at least 2 characters at the end if not it adds 0 at the end.

Copy link
Author

@Nataliia74 Nataliia74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you describe in terms of whole minute, or use ChatGPT to find out how else the code can be described?

In this code:

const remainingSeconds = movieLength % 60;
const totalMinutes = (movieLength - remainingSeconds) / 60;

movieLength % 60 gets the leftover seconds
(movieLength - remainingSeconds) / 60 gives the whole minutes only

So totalMinutes is the duration in terms of whole minutes, with all partial seconds removed.

Copy link
Author

@Nataliia74 Nataliia74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JS keyword null begins with a lowercase letter.

Got it.

Copy link
Author

@Nataliia74 Nataliia74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you type console.log() or console.log? They have different meaning in the JS language.

So, console.log() called function with possible input in it, otherwise console.log just refers to the object (function), but doesn't call function. I typed console.

Copy link
Author

@Nataliia74 Nataliia74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the files in the "prep" folder part of Sprint-1 exercise?

Sorry, no. Should I remove this folder on this branch?

Copy link
Author

@Nataliia74 Nataliia74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • You described two operations, which operation is carried out first?

  • We could also use the verb "remove" to describe what carPrice.replaceAll(",","")

So, first, we had the carPrice variable with the value "10,000", then we reassigned the variable by replacing coma with "" and transformed it to a number, and the value became 10000.
1 - remove all comas, 2 - transfotm into number.

Copy link
Author

@Nataliia74 Nataliia74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for bringing my attention to important details. I made the necessary remediations.

@Nataliia74 Nataliia74 added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jun 21, 2025
@Nataliia74 Nataliia74 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 21, 2025
@cjyuan
Copy link
Contributor

cjyuan commented Jun 22, 2025

Why didn't you try responding to inline comments directly in the thread? It makes tracking responses easier.
image

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 22, 2025
@Nataliia74 Nataliia74 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 22, 2025
@cjyuan
Copy link
Contributor

cjyuan commented Jun 22, 2025

Good job!

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Jun 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complete Volunteer to add when work is complete and all review comments have been addressed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants