You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 1. const penceString = "399p": initialises a string variable with the value "399p"
28
+
// 3. Declares a variable with the value of "399" by truncating the character `p`
29
+
// 8. Declares a variable with the value of "399" by prefixing with three `0`
30
+
// but does not actually do that because the length of the string is 3 and prefixing three `0` exceeds the length
31
+
// 9. Declares a variable by extracting the 3 pounds from the currency
32
+
// by using the substring method starting from the beginning of the string and going up by 1 unit
33
+
// 10. Declares a variable by extracting the pence from the currency
34
+
// by using the substring method starting from the end of the string and then add 2 `0` but does not do that because it exceeds the length of the string
35
+
// 18. Prints the currency by using the pounds variable prefixed with pound sign (£) and the pence variable which are separated with the . character
0 commit comments