Skip to content

Sheffield | ITP-Jan-26 | Hayriye Saricicek | Sprint 1 | Structuring and Testing Data#1126

Open
mshayriyesaricicek wants to merge 16 commits intoCodeYourFuture:mainfrom
mshayriyesaricicek:Sprint-1
Open

Sheffield | ITP-Jan-26 | Hayriye Saricicek | Sprint 1 | Structuring and Testing Data#1126
mshayriyesaricicek wants to merge 16 commits intoCodeYourFuture:mainfrom
mshayriyesaricicek:Sprint-1

Conversation

@mshayriyesaricicek
Copy link

Self checklist

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

Changelist

I am completing the exercises on Sprint 1. I am making commits as I continue.

@mshayriyesaricicek mshayriyesaricicek added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 2, 2026
const dir = ;
const ext = ;
const dir =filePath.slice(0, lastSlashIndex)
const ext =base.slice(base.lastIndexOf(".") + 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Code is correct.

Have you followed the suggestion in https://github.com/mshayriyesaricicek/Module-Structuring-and-Testing-Data/blob/main/readme.md to enable "Format on Save/Paste" on your VSCode? Doing so can help keep your JS code formatted consistently. For examples, it would

  • Ensure one space between each operator
  • Terminate each statements by a semicolon

This is the result of auto-format.

const dir = filePath.slice(0, lastSlashIndex);
const ext = base.slice(base.lastIndexOf(".") + 1);

Copy link
Author

Choose a reason for hiding this comment

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

Thank you. Format on Save was not switched on so I have switched it on now.

Comment on lines +12 to +15

//num is a random number between 1 and 100
//Math.floor rounds the decimal number to nearest lower number
// Math.random() generates a random decimal number between 0 and 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Phrases like "a number between X and Y" are not precise enough in a program specification, because they do not clearly state whether the endpoints X and Y are included.

We can also use the concise and precise interval notation to describe a range of values.

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

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

Copy link
Author

Choose a reason for hiding this comment

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

Thank you. I have changed this now.

Comment on lines +18 to +19
function last4Digits(cardNumber)
return `${cardNumber}`.slice(-4);
Copy link
Contributor

Choose a reason for hiding this comment

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

The syntax of this function definition is not quite correct.

const 24hourClockTime = "08:53"; No newline at end of file
const 24hourClockTime = "08:53";
// variable names cannot begin with a number
// can change to ClockTime12Hour and ClockTime24Hour or something similar to make it valid No newline at end of file
Copy link
Contributor

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)

Comment on lines +21 to +22
What is the return value of `prompt`?
when I do console.log(answer); it returns the value myName
Copy link
Contributor

Choose a reason for hiding this comment

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

If we were writing a program that uses prompt() to ask for an input value, how could
the program find out if the user clicked "OK" or "Cancel"?

Copy link
Author

Choose a reason for hiding this comment

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

Using console.log shows whether the user has clicked Ok or Cancel or typed their name. I have ameded my answers to show this.


console.assert tests for a condition but only returns a message if the condition is false. For instance it may be used to check the age of a person to restrict access to a site for adults only.

the full stop is used to separate the object from the method. Console is the object and log and assert are methods No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

. is an operator. Can you also find out the name of this operator and what it does in general?

Copy link
Author

Choose a reason for hiding this comment

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

I have added more comments to explain the dot operator.

@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 Mar 2, 2026
@mshayriyesaricicek mshayriyesaricicek added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants