I'm learning JavaScript for backend and i'm struggling to understand what is the safest object creation method. Factory Functions? Eventmittler3? Class with Object.create? Or its depend on where i will use? If so, can you please explain how can i aarchieve this 'finding best method' what should i look for?
function person(name, age){
return {name, age}
}
is something like that safe to use creation users in an production-ready app?