Below is the example of the string length Property.
// length property for string
object.length where the object can either be a string object or an array object
Input : print("GeeksForGeeks".length) Output :13 Input : print([1, 2, 3, 4, 5, 6, 7, 8, 9].length) Output :9
In the first example, 13 is the number of characters in the string “GeeksForGeeks”, hence the output is 13.
And likewise in the second example, the length of the array is 9 and so is the output
- TypeScript | String Length Property
- HTML | DOM History length Property
- HTML | Window length Property
- HTML | DOM length Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.