Skip to content

London | 26-ITP-May | Dagim Daniel | Sprint 1 | 1-key-exercise -count #1375

Open
Dagim-Daniel wants to merge 4 commits into
CodeYourFuture:mainfrom
Dagim-Daniel:coursework/sprint-1
Open

London | 26-ITP-May | Dagim Daniel | Sprint 1 | 1-key-exercise -count #1375
Dagim-Daniel wants to merge 4 commits into
CodeYourFuture:mainfrom
Dagim-Daniel:coursework/sprint-1

Conversation

@Dagim-Daniel

Copy link
Copy Markdown

… created a branch coursework/sprint-1.

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

i just created a branch coursework/sprint-1 and also answered 1-key exercise through multiple line comment.

Questions

we can answer some question through comment right?

@Dagim-Daniel Dagim-Daniel added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Structuring-And-Testing-Data The name of the module. labels Jun 21, 2026
@Dagim-Daniel Dagim-Daniel added the 🏕 Priority Mandatory This work is expected label Jun 26, 2026
Comment on lines +11 to +18
// breaking down the expression into smaller parts.
/* Math.floor(): this will return the largest integer less than or equal to a given number. In this case, it will round down the result of the expression inside the parentheses.
Math.random(): this will return a random floating-point number between 0 (inclusive) and 1 (exclusive). In this case, it will generate a random number between 0 and 1 but never exactly 1.
(maximum - minimum + 1): this will calculate the range of numbers we want to generate. In this case, it will calculate the difference between the maximum and minimum values (100 - 1 = 99)
and add 1 to include both endpoints (99 + 1 = 100).
finally, the code adds the minimum value (which is 1) to the result.
*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note: To describe a range of numbers, we could use the concise and precise interval notation:

  • [, ] => inclusion
  • (, ) => exclusion

For example, [1, 10) means, all numbers between 1 and 10, including 1 but excluding 10.

Comment on lines +1 to 2
const cardNumber = "4533787178994213";
const last4Digits = cardNumber.slice(-4);

Copy link
Copy Markdown
Contributor

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) to still being able to use .slice(-4) to extract the last 4 digits from the given number.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

i will use .toString() for conversion.

Comment thread Sprint-1/3-mandatory-interpret/1-percentage-change.js
@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 27, 2026
@cjyuan

cjyuan commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

we can answer some question through comment right?

If the questions are placed in the comments, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Structuring-And-Testing-Data The name of the module. 🏕 Priority Mandatory This work is expected Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants