Removing variable declaration from inside 'for loop' declaration