Getting 'variable is not defined at client' error

I am trying to access a variable I declared however I am getting undefined. I declared the variable using the 'var' keyword in an if-statement(for a discord bot command) and tried accessing its value in another if-statement but that is not working, anyone could know whats the problem ? A similar example to my problem could be shown here: [NodeJS]
if (command == 'bla'){
var number = 7;
if (command == 'vla'){
var newNumber = number + 2;

You are viewing a single comment. View All

@AkonZ I am going off of the sparse code you posted. Post your Repl and maybe we can help you further. But my explanation is correct. I don't even know what your goal is because you didn't fully explain it. This is a poor excuse of asking a question on Replit.