var is the old way to declare variables in JavaScript. Use let when reassignment is allowed and const when it isn’t in source

// username can be reassigned, so we use `let`
let username = "dengar_the_bh";
username = "boba_fett";
 
// smsSendingLimit can't be reassigned, so we use `const`
const smsSendingLimit = 1000;

var is function-scoped, so a variable declared inside an if block can leak outside it! let and const are block-scoped, which is always usually what you want.