In JavaScript (and TypeScript) is there any difference between using a class vs an object to namespace methods from a performance perspective? And are there any other reasons to prefer one option over the other?
export const UserService = {
async findMany() {
// ...
},
async findById(id: number) {
// ...
}
}
export class UserService {
static async findMany() {
// ...
}
static async findById(id: number) {
// ...
}
}