+ 5
How to get a last element of an array or string?
E.g: var arr = "abc" to get a letter "a" i use var a = arr[0] And how to get "c"?
2 ответов
+ 4
arr[arr.length-1]
+ 1
arr="abc";
012
arr.length==3;
E.g: var arr = "abc" to get a letter "a" i use var a = arr[0] And how to get "c"?