I have a replacement for class User ...
as a factory function below:
const user = (name, age) => {
return {
name: name,
age: age,
}
}
I have an admin
, too, that I would normally extend
using ES6 classes. How would I do this using spread to give admin
the properties of user
as well?
const admin = (level) => {
return {
level: level,
}
}