Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Function & Classes Naming Convention | JavaScript syntax
Introduction to JavaScript (staging)
course content

Conteúdo do Curso

Introduction to JavaScript (staging)

Introduction to JavaScript (staging)

1. Introduction
2. JavaScript syntax
3. Data Types and Variables

bookFunction & Classes Naming Convention

Function naming convention

Function's names are formatted in camelCase notation. It’s a best practice to include the verb as a prefix in the function name that tells the purpose of the function.
In JavaScript function is just like a procedure or collection statements of calculating a value or perform a task. We will learn about the functions in detail in the later sections.

1234567
// Descriptive name of function function getName(firstName, lastName) { return `${firstName} ${lastName}`; } const myName = getName('Bob','William'); console.log(myName);
copy

Classes naming convention:

Class is declared with a PascalCase. Class is like a template for creating objects. They encapsulate data with code to work on that data. We will study the classes in detail in later sections.

123456789
class WebDeveloper { constructor(firstName, lastName) { this.firstName = firstName; this.lastName = lastName; } } const robinWieruch = new WebDeveloper('Robin', 'Wieruch'); console.log(robinWieruch);
copy

Note:

Classes are very advanced topics and will be covered later, so no exercises for this topic for now.

Summary:

  • Naming convention purpose logic in your code. It is the standard in the JS community.
  • Variables are case-sensitive.
  • Constants are written in UPPERCASE (capital letters).
  • Prefixes are added in the booleans for clarity.
  • Functions names are formatted in camelCase notation.
  • Class is declared with a PascalCase.

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 11
toggle bottom row

bookFunction & Classes Naming Convention

Function naming convention

Function's names are formatted in camelCase notation. It’s a best practice to include the verb as a prefix in the function name that tells the purpose of the function.
In JavaScript function is just like a procedure or collection statements of calculating a value or perform a task. We will learn about the functions in detail in the later sections.

1234567
// Descriptive name of function function getName(firstName, lastName) { return `${firstName} ${lastName}`; } const myName = getName('Bob','William'); console.log(myName);
copy

Classes naming convention:

Class is declared with a PascalCase. Class is like a template for creating objects. They encapsulate data with code to work on that data. We will study the classes in detail in later sections.

123456789
class WebDeveloper { constructor(firstName, lastName) { this.firstName = firstName; this.lastName = lastName; } } const robinWieruch = new WebDeveloper('Robin', 'Wieruch'); console.log(robinWieruch);
copy

Note:

Classes are very advanced topics and will be covered later, so no exercises for this topic for now.

Summary:

  • Naming convention purpose logic in your code. It is the standard in the JS community.
  • Variables are case-sensitive.
  • Constants are written in UPPERCASE (capital letters).
  • Prefixes are added in the booleans for clarity.
  • Functions names are formatted in camelCase notation.
  • Class is declared with a PascalCase.

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 11
toggle bottom row

bookFunction & Classes Naming Convention

Function naming convention

Function's names are formatted in camelCase notation. It’s a best practice to include the verb as a prefix in the function name that tells the purpose of the function.
In JavaScript function is just like a procedure or collection statements of calculating a value or perform a task. We will learn about the functions in detail in the later sections.

1234567
// Descriptive name of function function getName(firstName, lastName) { return `${firstName} ${lastName}`; } const myName = getName('Bob','William'); console.log(myName);
copy

Classes naming convention:

Class is declared with a PascalCase. Class is like a template for creating objects. They encapsulate data with code to work on that data. We will study the classes in detail in later sections.

123456789
class WebDeveloper { constructor(firstName, lastName) { this.firstName = firstName; this.lastName = lastName; } } const robinWieruch = new WebDeveloper('Robin', 'Wieruch'); console.log(robinWieruch);
copy

Note:

Classes are very advanced topics and will be covered later, so no exercises for this topic for now.

Summary:

  • Naming convention purpose logic in your code. It is the standard in the JS community.
  • Variables are case-sensitive.
  • Constants are written in UPPERCASE (capital letters).
  • Prefixes are added in the booleans for clarity.
  • Functions names are formatted in camelCase notation.
  • Class is declared with a PascalCase.

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Function naming convention

Function's names are formatted in camelCase notation. It’s a best practice to include the verb as a prefix in the function name that tells the purpose of the function.
In JavaScript function is just like a procedure or collection statements of calculating a value or perform a task. We will learn about the functions in detail in the later sections.

1234567
// Descriptive name of function function getName(firstName, lastName) { return `${firstName} ${lastName}`; } const myName = getName('Bob','William'); console.log(myName);
copy

Classes naming convention:

Class is declared with a PascalCase. Class is like a template for creating objects. They encapsulate data with code to work on that data. We will study the classes in detail in later sections.

123456789
class WebDeveloper { constructor(firstName, lastName) { this.firstName = firstName; this.lastName = lastName; } } const robinWieruch = new WebDeveloper('Robin', 'Wieruch'); console.log(robinWieruch);
copy

Note:

Classes are very advanced topics and will be covered later, so no exercises for this topic for now.

Summary:

  • Naming convention purpose logic in your code. It is the standard in the JS community.
  • Variables are case-sensitive.
  • Constants are written in UPPERCASE (capital letters).
  • Prefixes are added in the booleans for clarity.
  • Functions names are formatted in camelCase notation.
  • Class is declared with a PascalCase.

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Seção 2. Capítulo 11
Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
some-alt