What is the meaning of myarr. length -1? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the meaning of myarr. length -1?

How should we use it?

29th Aug 2020, 3:23 AM
Indian
Indian - avatar
4 Answers
+ 3
One less than the length of the myarr array.
29th Aug 2020, 4:35 AM
Sonic
Sonic - avatar
+ 2
Length is a final variable applicable for arrays. It helps to get the size of the array. "myarr" must be an array. And that - 1reduces the size of array by 1. If you want to get number of characters in a string than you can use length().
29th Aug 2020, 3:39 AM
Aman Kumar
Aman Kumar - avatar
+ 1
means array length - 1 Example: if your array has length = 5 if you use method (.length) - 1 means = 4
29th Aug 2020, 3:40 AM
S H
S H - avatar
0
I think it can be used to delete a letter from word. Mean it is part of code for backspace button.
29th Aug 2020, 4:36 AM
Divya Mohan
Divya Mohan - avatar