Skip to content

Barcelona | Oct2025-2 | Roman Pavlenko | Sprint-1 | Coursework#1

Open
DraftRoman wants to merge 13 commits intomainfrom
exercises-of-sprint-1
Open

Barcelona | Oct2025-2 | Roman Pavlenko | Sprint-1 | Coursework#1
DraftRoman wants to merge 13 commits intomainfrom
exercises-of-sprint-1

Conversation

@DraftRoman
Copy link
Copy Markdown
Owner

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 Barcelona | Oct2025-2 | Roman Pavlenko | Sprint-1 | Coursework
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Explained what the line 1 and the line 7 did. Added comments, and  consol.log to see the output in the terminal
Expected output: "CKJ"
- used charAt method to get first character of the name
- used with word as a array of símbolos
- used slice method to have a part of array
- used lastIndexOf to find special symbols and grab the text before and after them
- Worked with random function and which numbers are inclusive or exclusive
How make comments
- multi-line /*   */
- single-line //
- declare a variables correctly, let instead of const
The error was an order error - declaration must come before usage
The error occurs because cardNumber is a number, and the slice() method is not defined for numbers. The slice() method is a string method, so to use it, we need to convert cardNumber to a string first.
- to string().slice(-4)
- Number to make it number again
- typeof to specify the type of variable
Variable names cannot start with a number
.replaceAll(",", ""));
-added comments, answers to the questions a-e.
- got familiar with % operation
- gave answers to the questions a-f
- added console.log to have a cleave view
- added comments to specify each step
explore methods, property and accessors inside console.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant