Dont-Reassign-Foreach-Variables
Documentation Index
Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt
Use this file to discover all available pages before exploring further.
Sourcery rule id: dont-reassign-foreach-variables
Section titled “Sourcery rule id: dont-reassign-foreach-variables”Description
Section titled “Description”Don’t reassign the for-each variable ${var}
for (var str of strings) { str = "";}Explanation
Section titled “Explanation”Reassigning the iteratee in a for-of loop may lead to unexpected behaviour, and the variable should be treated as if it were constant.