.length
Try it yourself →Returns the number of characters.
Syntax
text.length
Description
Returns how many characters the text consists of (property, not a method — no parentheses).
Returns
Length (number).
Example
console.log("hello".length);Expected output
5
When to use?
Password length, character limit check.