Closed dmcote-1991 closed 1 month ago
Yep, it’s been a while since I’ve used var, this code is just very old (written before those were apart of the language). I’d be fine with such a refactor.
Great! I'll start getting to work on it. Thank you for the opportunity :)
Hi patorjk,
I've created a Pull Request to address issue #116, where I refactored var to let and const. Please take a look when you have a chance!
Thanks!
Looks good, thank you!
@all-contributors please add @dmcote-1991 for code.
Proposal: Refactor
var
Declarations tolet
andconst
I would like to propose a refactor of the code to replace
var
declarations withlet
andconst
where appropriate. This change aims to improve code readability and adhere to modern JavaScript best practices.Proposed Changes
var
tolet
: For variables that are reassigned.var
toconst
: For variables that are not reassigned after initialization.Benefits
let
andconst
provide block scope, making the code easier to understand and less prone to errors related to variable scope.let
andconst
aligns with current JavaScript standards and practices.Example
Here’s a snippet of the code I am referring to:
Current Code:
Proposed Changes
I propose changing the code to:
Questions
Thank you for considering this refactor. I believe it will contribute to a cleaner and more maintainable codebase.