Exercise 1
Update the function maskCardNumber
to return the cardNumber
with only the last 4 digits displayed and the rest replaced with *
. The length of the card number can vary.
Exercise 2
It should be written JavaScript
and not javascript
.
Update the function fixJavaScript
to return the fixed version of the below excerpt from an interview with Brendan Eich, the founder of JavaScript before he sees it.
Exercise 3
Update function trimUnits
such that it clears out the unit mentioned (px
, em
, cm
etc) and returns the numerical value.
For example: 4px
should return 4. The length of all units will be given as unitLength
.
Exercise 4
Fix the error in the code below
by using the correct method:
We are not displaying the answer for this exercise.
We do this because we want you to challenge yourself
and
not give in to the temptation of looking at the solution.
We also don't want to leave you stuck, so if you feel
you have tried enough and are still unable to solve
this exercise, feel free to ask in our community.
Here is the link to join the community.