Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Strings 2/5 | Data Types and Variables
Introduction to JavaScript

book
Strings 2/5

String length:

We use the length property to check the length of the string.

console.log(`JavaScript`.length );
1
console.log(`JavaScript`.length );
copy
Compito

Swipe to start coding

The task is to create a string variable named running and assign the value The horse runs so fast to it. Now check the length or number of characters in the above variable.

Soluzione

let running ="The horse runs so fast";
console.log(running.length);

Note: length property also considers the spaces between the string length.

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 3. Capitolo 20

Chieda ad AI

expand
ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

some-alt