Closed roberto-butti closed 1 year ago
Hi @roberto-butti , I would like to work on this issue can you make me as assignee?
@roberto-butti could you please elaborate my task, the file and the documentation is written already it seems.
Hi @GriffinAnnshual , Exactly i already created the file as a placeholder, especially for new contributors. As you can see in the naming of the file we are following an internal convention (src/content/docs/05-string/02_str-padding.md). So, in your case, you can explain the padStart() and padEnd() functions where you have the titles:
## Padding from the start of the string: `String.padStart()`
and
## Padding from the start of the string: `String.padEnd()`
Additional note: i see that padStart is useful for padding some numbers, so you can also add an example like this one:
let num = 15;
num.toString().padStart(32, '0');
Another thing to mention is that you can use a string (not just one single character) like this:
"hello".padStart(10,'-*');
Shall I add the examples in the "examples" directory?
Thank you @roberto-butti, I've made the PR.
Yes, if you can and want. Otherwise, if you want to skip it, you can write a comment when you open a PR, i will create a new issue specifically for the example. Find the way that is most comfortable for you.
Roberto
Thank you for the PR! I see you added also examples, great!
I am glad to have contributed to this project @roberto-butti, you're so receptive. Thank you so much.
What
Add a new method documentation file for a new JavaScript function in
src/content/docs
. The instructions about defining the file's name are documented in theCONTRIBUTING.md
file.Description
Function name:
padStart()
andpadEnd()
Function description: ... File name:src/content/docs/05-string/02_str-padding.md
Checklist
examples
directorybun run format-examples-bun
ornpm run format-examples
Must read: