The first if statement
if(command.name)
checks, whether the property name of commands is empty or not.
- If it’s empty, it will **not execute the code inside the brackets and jump straight to the
else block - If not, it will execute the code inside the brackets
The second line
client.commands.set(command.name, command);
calls the .set() function to add a new command with these parameters to the commands collection:
command.nameobviously the name of thecommandto be added- the
commandobeject itself with all properties and executable functions
solved What does this if-statement exactly do?