These are a collection of tips and tricks you can use to improve the performance and readability of your code.
We commonly increment a number using the += operator. Did you know there are assignment shorthands for other operations as well?
To remove the largest value from an array of numbers we first need to find that number and can then filter it out.
We can pass an array to JavaScript’s sort function to sort an array of objects by one of their properties.
As soon as a concatenation of conditions is clear, JavaScript stops the evaluation. It does not do work that does not change the result.
Instead of removing elements from an array one by one, we can modify the array itself to clear it in one operation.
Putting complex logic into a function increases code readability. By giving that function a descriptive name, it can explain what is happening in it.
We can “freeze” objects to make it impossible to change them after their creation.
We no longer need to install dependencies to pad a string with characters to the left or right of it.