I have an array of strings. I want to remove first character from each element of that array.
I looped through the array and tried to remove the first character by using substr method.
var x = ["X2019","X2020","X2021","X2022"];
for(i = 0; i < x.length; i++) {
result = x[i].substr(1);
}
console.log(result);
I need an array like
result = ["2019","2021","2022"];
resultis not an array. Second,substrreturns a new string. Third try functional looping methods likeArray.map