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 @@ -27,6 +27,8 @@ console.log(`£${pounds}.${pence}`);
2727// Try and describe the purpose / rationale behind each step
2828
2929// To begin, we can start with
30+
31+ // Answers
3032// 1. const penceString = "399p": initialises a string variable with the value "399p"
3133// 2. const penceStringWithoutTrailingP = penceString.substring(0, penceString.length-1): this
3234// variable creates a new string that cuts the penceSting to 399,so it basically creates a new
@@ -43,7 +45,7 @@ console.log(`£${pounds}.${pence}`);
4345// this variable creates a new string from the paddedPenceNumberString variable using the subString
4446// function. This time it creates a new string from the last 2 indexes. Furthermore it sets the target
4547// length for this new variable to 2 and if is is less than 2 it sets a condition to add
46- // a "0" in front
48+ // a "0" at the end by using the padEnd() function
4749
4850
4951//6. console.log(`£${pounds}.${pence}`); this is a function call that displays the final amount in
You can’t perform that action at this time.
0 commit comments