Nothing is more confusing than seeing code where there is no consistency. All the things like; formatting, casing, name conventions, documentation. It could make your life easier if they are consistent. Try to do everything in one way, and make conventions/guidelines with your co-workers. So you will generally continue to do this the same way. But for example, when reviewing each other’s code, try adapting their approach and the way they do things to understand each other.
When dealing with something difficult, try to ask for help on time. I made this mistake too often in the past, and be struggling for hours. Timebox something and spend a maximum of 30 minutes. If you didn’t found a solution on time, try to rehearse the problem in your head before asking. Most of the time you discover the answer your self. Still no solution? Ask a colleague to view the problem. An outsider has other insights and speeds up problem-solving. …
An overview of only the array methods that can mutate the original array. Some of these are already well-known, and some of them aren’t used as often. Let’s get through them all, without difficult explanations.
Note: this also applies for TypeScript
The most well-known method is
push. In the example below, we have an array of two names (strings). With
push, you add an item to the end of an array.
const array = ['John', 'Jeroen'];
array.push('Peter');console.log(array);// ['John', 'Jeroen', 'Peter']// You can also add more arguments by separating them by a comma. E.g. array.push('Bob', 'Alice').
unshift you can add an item to the beginning of an array. It is called unshift because it’s the opposite of
shift (which I explain later). …
As a developer, you should have heard of the term ‘DRY’ — Don't Repeat Yourself. You should avoid writing the same sentence over and over. This doesn’t only apply for code but also for documentation. And who wants to write basic documentation for fun?
To improve and speed up contribution to a project, you need documentation. Every project you worked on, has some kind of basic Markdown documentation:
A README to describe what the project is about, how to install and start the project.
This could be a Pull Request template to instruct contributors on how to set up a pull request. …