9 JavaScript Tricks To Code Like A Pro!
Code like a professional JavaScript developer using modern techniques, tips and tricks 👨💻👩💻
When I first began coding JavaScript I found myself writing code that is not “good” code as I was often using the old JavaScript specification/features and many times my code could have been restructured and simplified to make it more concise using some of the JavaScript modern features.
Today I will share my top 9 tips, tricks and features of JavaScript in no particular order that will help improve your code quality and will be useful when coding your next app! 🚀
1. Arrow Functions ➡️
ES6 introduced Arrow Functions which makes the function code look a lot cleaner and overall faster to write!
Instead of declaring functions like this:
const multiply = function(x, y) {
return x * y;
};
Achieve the same result with less code
const multiply = (x, y) => {
return x * y;
};
This can be then further simplified if only one expression is present
const multiply = (x, y) => x * y;