JS check the length of a string code example
Example 1: js string length
let str = "foo";
console.log(str.length);
// 3
Example 2: javascript string length
const s = 'Hello, World!';
console.log(s.length);
let str = "foo";
console.log(str.length);
// 3
const s = 'Hello, World!';
console.log(s.length);