Clean the Username
JavaScript
10 pts
Clean the Username
The starter has let input = " SeLaM_Asmara "; — a username typed carelessly.
- Create
clean:inputtrimmed and in lower case (usetrim()andtoLowerCase()). Print it. - Print the length of
clean. - Print whether
cleanincludes"asmara". - Print the first 5 characters of
cleanwithslice.
Do not change input. Expected output:
selam_asmara 12 true selam
Checklist
- Create
cleanwithtrim()andtoLowerCase(), leavinginputunchanged. - Check the text with
includes. - Cut the first 5 characters with
slice. - Print the four lines.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
