📜  7.3.2.长度或 .length - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:54.108000             🧑  作者: Mango

代码示例1
/*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