Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Clean JavaScript
Rating: 4.6 out of 5(12 ratings)
103 students

Clean JavaScript

Learn how to write concise and maintainable code
Created byJan Guardian
Last updated 5/2023
English

What you'll learn

  • Write neat and comprehendible JavaScript
  • Make your JavaScript more readable and maintainable
  • Learn smart and concise JavaScript syntax
  • Become a better JavaScript developer

Course content

1 section22 lectures2h 0m total length
  • Introduction2:13
  • Arrow functions3:28

    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.

  • Automatic semicolon insertion4:11

    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.

  • Computed property names3:46

    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 clause2:50

    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.

  • If statement6:17
  • Logical operators4:59

    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.

  • Logical assignment operators5:32

    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.

  • Optional chaining2:37
  • Template literals7:18
  • Ternary operator6:52
  • For loops4:38
  • Break & continue4:09
  • Spread & rest8:20
  • Object destructuring8:42
  • Map & filter8:13
  • Reduce9:16
  • Some & every5:56
  • Asynchronous code4:56
  • Syntax shortcuts10:09
  • Conversions3:49
  • Conclusion1:57

Requirements

  • Basic knowledge and understanding of JavaScript is required

Description

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.

Who this course is for:

  • Amateur and professional JavaScript developers willing to learn advanced syntax and techniques that will let them write cleaner code.