str str.length - 1 javascript code example Example: javascript string length const s = 'Hello, World!'; console.log(s.length);