The problem of automatic conversion of JS data subscript

var arr = [1,2,3,4,5,6,7]
for(var j in arr){
   console.log(j+1);
   console.log(j-1);
}

automatically converts j to string processing when outputting jroom1.
will be processed digitally when outputting jmur1.
what is the reason for this?

Mar.02,2021
The variables of the

for in loop are all strings (index), + can be used as string concatenators, you can change it to
console.log (+ jung1);


upstairs positive solution.
add that for in traversal is not recommended for arrays.
get into the habit of writing canonical code.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b225f2-4e279.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b225f2-4e279.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?