This commit is contained in:
Rohit Tanwar
2018-01-09 10:23:43 +05:30
parent 67a6482d95
commit 59f23e6579
2 changed files with 3 additions and 3 deletions

View File

@ -44,13 +44,13 @@ Here's what you can do to help:
- If your variable is not changed anywhere in the code name it in uppercase. - If your variable is not changed anywhere in the code name it in uppercase.
- Use `camelCase` for function and variable names if they consist of more than one word. - Use `camelCase` for function and variable names if they consist of more than one word.
- Try to give meaningful names to variables. For example use `letter`, instead of `lt`. Some exceptions to convention are: - Try to give meaningful names to variables. For example use `letter`, instead of `lt`. Some exceptions to convention are:
- `arr` for arrays (usually as the snippet function's argument). - `arr` for lists (usually as the snippet function's argument).
- `str` for strings. - `str` for strings.
- `n` for a numeric value (usually as the snippet function's argument). - `n` for a numeric value (usually as the snippet function's argument).
- `val` or `v` for value (usually when iterating a list, mapping, sorting etc.). - `val` or `v` for value (usually when iterating a list, mapping, sorting etc.).
- `i` for indexes. - `i` for indexes.
- `func` for function arguments. - `func` for function arguments.
- `nums` for arrays of numbers. - `nums` for lists of numbers.
- Use `()` if your function takes no arguments. - Use `()` if your function takes no arguments.
- Specify default parameters for arguments, if necessary. It is preferred to put default parameters last unless you have pretty good reason not to. - Specify default parameters for arguments, if necessary. It is preferred to put default parameters last unless you have pretty good reason not to.
- If your snippet's function takes variadic arguments, use `...args` (although in certain cases, it might be needed to use a different name). - If your snippet's function takes variadic arguments, use `...args` (although in certain cases, it might be needed to use a different name).

View File

@ -1,6 +1,6 @@
### chunk ### chunk
Chunks an array into smaller arrays of a specified size. Chunks an array into smaller lists of a specified size.
Uses `range` to create a list of desired size. Then use `map` on this list and fill it with splices of `arr` Uses `range` to create a list of desired size. Then use `map` on this list and fill it with splices of `arr`