Back to Course

Introduction to JavaScript

0% Complete
0/0 Steps
  1. JavaScript: Basics
    9Topics
    |
    10 Quizzes
  2. JavaScript: Variables
    9Topics
    |
    10 Quizzes
  3. JavaScript: Conditional Statements
    10Topics
    |
    11 Quizzes
  4. JavaScript: Functions
    10Topics
    |
    11 Quizzes
  5. JavaScript: Scope
    6Topics
    |
    7 Quizzes
  6. JavaScript: Arrays
    11Topics
    |
    12 Quizzes
  7. JavaScript: Loops
    8Topics
    |
    9 Quizzes
  8. JavaScript: High Order Functions
    3Topics
    |
    4 Quizzes
Lesson 1, Topic 7
In Progress

JavaScript: Properties

Yasin Cakal 27 Oct 2021
Lesson Progress
0% Complete

When you add new data to a JavaScript program, the browser stores it as an instance of the data type. Each string instance contains a length property that holds the number of characters in the string. You may get property information by appending a period and the property name to the string:

console.log('CodeOfCode'.length); // Prints 10

The . is yet another operator! We call it the dot operator.

In the above example, the value saved to the length property is obtained from the instance of the string, 'CodeOfCode' because the word CodeOfCode has ten characters, the program prints 10 to the terminal.

%d bloggers like this: