
An arrow function is a compact alternative to the traditional function. While it has its limitations, which I strongly recommend you to get acquainted with on MDN, it is a neat way of writing simple functions in one line. In this lesson we are going to take a look at how arrow functions can help you make your code tidy.
Most of the developers out there are so used to having semicolons in their JavaScript code that they start thinking it’s a must. Other languages do use semicolons extensively and require them indeed, but JavaScript is an exception.
In this lesson we are going to take a look at when you can omit semicolons in JavaScript (spoiler alert – you can do that in most cases) to remove visual clutter from your code and make it neat.
Developers are quite used to assigning values to object properties with the dot notation to address the property in question. But this is not always the cleanest way. In this lesson we are going to take a look at some scenarios where you can use the dynamic and computed property names to write neater code.
Guard clauses are a neat alternative to ‘if…else’ statements in the sense that they too safeguard your logic from unwanted executions, albeit do that in a more concise manner.
In this lesson we are going to take a look at what they are and how you can use them to keep your code straightforward and clean.
You are probably familiar with the logical ‘AND’ and ‘OR’ operators in Javascript — the first one is denoted by two ampersands and the second one by two pipes. You surely have come across them being used in ‘if…else’ statements but their application goes way beyond this.
In this lesson we are going to take a look at a few scenarios where the logical operators might come in handy and be a cleaner way of writing conditional logic.
You are probably already familiar with assignment operators in JavaScript. These resemble the regular equals sign assignment operator in that they also assign a value to a variable. But instead of assigning the value specified after the equals sign they take that value and add it to the variable, subtract it from the variable, multiply or divide the variable by it, or perform other handy math operations.
But JavaScript code isn’t always about math. What if you had to assign a value to a variable, or an object property, under a certain condition? Conviniently, JavaScript has a set of assignment operators to help you do that. In this lesson we are going to take a look at them to see how they can help you write cleaner code.
Being a professional developer goes way beyond being able to solve a business task programmatically in the most rational way possible. It is also about doing it in a way that is easily comprehendible by the team and future you, and is open to change at any point in time. As Ward Cunningham, one of the authors of the Agile Manifesto, once put it:
You can call it beautiful code when the code makes it look like the language was made for the problem.
JavaScript in this sense has a whole set of features capable of solving most problems in a very elegant and straightforward way.
The Clean JavaScript course will teach you a wide spectrum of concepts and capabilities of the language that can help you write clean, concise, maintainable, and readable code. By the end of this course you will gain new skills and master new syntax that will make you a smarter JavaScript developer and a better team player.
The course consists of 20 lessons. Each lesson has an interactive coding challenge in the end that will let you take a shot at applying what you’ve just learned. Depending on your professional level there will likely be some things that you already know, but the course also covers some smart tricks and approaches that you haven’t yet seen.