Answers for "7.3.2. Length or .length"

0

7.3.2. Length or .length

/*The most useful string property is named length, and it tells us how 
many characters are in a string.*/

let firstName = "Grace";
let lastName = "Hopper";

console.log(firstName, "has", firstName.length, "characters");
console.log(lastName, "has", lastName.length, "characters");

//Grace has 5 characters
//Hopper has 6 characters
Posted by: Guest on June-13-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language