Message from JavaScript discussions

April 2019

— And object option would make much more sense too

— 

new Sim({
name: { first: 'John', last: 'Doe' },
gender: 'male',
photo: ...,
personality: {
neat: true,
outgoing: true
}
});

— The above makes much more sense than:
new Sim(
'John',
'Doe',
'male',
...,
true,
true);

— This is advanced stuff

— No no

— Very simple :D

— How are you getting the values from the object, destructing?

— Could do, but don't have to

— Destructuring or not would be the constructors responsibility

— constructor(obj) {
this.name = obj.name;

— How is the constructor knowing what is it getting?

— Or:
constructor({ name, gender, ... }) {
this.name = name;
this.gender = gender;