Home / Javascript Tips Generated By ChatGPT / Avoiding var for Variable Declarations in Javascript Prefer let and const over var to avoid issues with scoping and hoisting. Source Code let age = 25; // Block scope and can be reassigned const name = "John"; // Block scope and cannot be reassigned