File tree Expand file tree Collapse file tree
Sprint-1/3-mandatory-interpret Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,3 +25,9 @@ console.log(`£${pounds}.${pence}`);
2525
2626// To begin, we can start with
2727// 1. const penceString = "399p": initialises a string variable with the value "399p"
28+ // 3-6. It is taking the vaule from pencestring and using substring to return part of the string, by -1 so from the end resualting in "399"
29+ // 8. It is now adding "0" infront of vaule if the vaule is under 3 characters in size.
30+ // 9-12. Using the substring function to reduce the size of the vaule to just 2 characters.
31+ // 14-16. Taking the value from paddedPenceNumberString and this time with substring, only showing the last 2 characters in teh value.
32+ // Then with using .padEnd it ensures that 2 characters are shown with 0 being there is nothing is there.
33+ // 18. Showing the resualt of the code starting with a "£" then the value of "pounds" then a "." and lastly value of "pence"
You can’t perform that action at this time.
0 commit comments