Special offers now — see discounted courses.
day
:
hour
:
min
:
sec
See special offers
JavaScript: Best Practices for Functions and Classes

JavaScript: Best Practices for Functions and Classes

1h 45mIntermediate2020-10-15

Authors

Sasha Vodnik

Sasha Vodnik

Principal Technical Course Developer at DocuSign

Course details

JavaScript uses C-based syntax, but the structures at its core, namely functions and classes, behave very differently than C behaves. Leveraging recommended techniques can help you develop JavaScript code that is more consistent and easier to maintain. In this course, explore best practices for architecting your programs. Consider ways that details can take paths that differ from other programming languages. Learn about creating well-built, organized, modular, and high-quality code by using a style guide, modern deployment tools, and strict mode. Discover how to carefully construct functions using more predictable expressions over declarations and by avoiding the modification of parameter values. Examine the dos—and don’ts—of “this” values and learn about which JavaScript features to avoid.

Skills covered

JavaScriptOracleProgramming LanguagesSoftware DevelopmentDeep Dive (X:Y)

Concepts

0. Introduction

  • 01 - Creating well-structured modular JavaScript
  • 02 - What you should know
  • 03 - Setting up your environment

1. Why Best Practices

  • 04 - Understanding style guides
  • 05 - Using modern deployment tools
  • 06 - Understanding ESLint
  • 07 - Foundational practice - Always use strict mode

2. Creating Functions

  • 08 - Use function expressions instead of declarations
  • 09 - Don't use the new keyword to construct functions
  • 10 - Leave parameter values untouched
  • 11 - Use arrow syntax for anonymous functions
  • 12 - Rely on implicit return only when obvious
  • 13 - Challenge - Create functions
  • 14 - Solution - Create functions

3. Creating Classes

  • 15 - Use PascalCase for naming classes and constructors
  • 16 - Use this only in classes or constructors
  • 17 - Return this from methods
  • 18 - Don't assign this to another variable
  • 19 - Challenge - Create classes
  • 20 - Solution - Create classes

4. Creating Modules

  • 21 - Configure module settings in ESLint
  • 22 - Default export constants when possible
  • 23 - Use case to indicate a module's default export type

5. Destructuring

  • 24 - Use object destructuring
  • 25 - Use array destructuring
  • 26 - Challenge - Destructure
  • 27 - Solution - Destructure

6. JavaScript Features to Avoid

  • 28 - Avoid eval
  • 29 - Avoid and
  • 30 - Avoid with
  • 31 - Avoid unary increments and decrements

Conclusion

  • 32 - Next steps

Related courses

Related learn paths

About us

LyndaKade is a leading learning platform that helps people learn business, software, technology, and creative skills to achieve personal and professional goals.

Phone numberAparat ChannelTelegram SupportTelegram ChannelInstagram Page

All rights to this site belong to LyndaKade.

Terms of Service|Privacy Policy

نماد الکترونیک enamad در صورت اتصال با آی‌پی داخل کشور، نمایش داده خواهد شد.
logo-samandehi - لوگو ساماندهی
zarinpal
zibal