Code highlights logo

Learn

Getting Started with JavaScript

Properties

In a JavaScript program, when you add a new piece of information, the browser stores it according to its particular type, like a number or a string. These types have special characteristics that can be used with each piece of information of that type.

For instance, a string has a characteristic called "length," which tells you how many characters are in it. You can find out this length by putting a dot and the word "length" after the string.

Here's an example:

1console.log('Hello'.length); // This will show 5

Here, the dot is a special symbol used in JavaScript, known as the dot operator.

In the example given, the number 5 is the value of the "length" characteristic for the string 'Hello'. The code will display 5 on the screen because the word 'Hello' contains five characters.


Instructions

1.

Print the value of the length property of the string "Programming" to the console.

Sign up to start coding

Already have an account?

Sign In

Course content