I have an array, its length can be up to 20 elements:
[ '0ad39f02478f5;',
'309c9e9051482;',
'dd7d5faf07569;',
'ghdg9f02478f5;',
'30967uj051482;',
'ad398ixc478f5;',
'39c9frtuyr482;' ]
I need to remove the semicolon from the last element in the array.
Here is the result I expect:
[ '0ad39f02478f5;',
'309c9e9051482;',
'dd7d5faf07569;',
'ghdg9f02478f5;',
'30967uj051482;',
'ad398ixc478f5;',
'39c9frtuyr482' ]
for (const value of Object.values(arrayOfJobs)) {
console.log(value)
const arrayLength = value.length - 1;
value[arrayLength].replace(';', '');
console.log(value)
}
I tried to do it like this, but it still doesn’t remove the semicolon at the end of the array. My problem is that the value is not assigned