Currently, I'm enhancing my understanding of Typescript with the development of a discord.js bot. However, I have come across a piece of code and I am uncertain about its redundancy:
import Discord from 'discord.js';
export default class Bot {
client: Discord.Client = new Discord.Client();
}
Is this the ideal way to define the client property, or should I opt for this approach instead:
client = new Discord.Client();
Both methods seem to function adequately, but I am unsure of which one aligns with best practices.
Your insights are greatly appreciated!