9 let ttl = 0
10 const totalBatches = Math.ceil(batch.length / batchSize)
11 if (batchDescription) {
12 task.output = `Running batches for: ${batchDescription}`13 task.output = ` ${batch.length} total transactions will be split in to ${totalBatches} batches`
14 } else {
15 task.output = `Batch runner: ${batch.length} total transactions will be split in to ${totalBatches} batches`
Consecutively reassigning to the same variable or property is a code smell and should be avoided. It is likely that this is the result of some undeleted code and can have unexpected side effects. The first assignment is rendered useless by the second and can therefore be removed without observing any changes to the value of the assignment target.
a[1] = 'something'
a[1] = 'some other thing'
a[1] = 'something'
if (condition()) {
a[1] = 'some other thing'
}