const proto = {
greet() {
return `Hello, I'm ${this.name}`;
}
};
const john = Object.create(proto);
john.name = 'John';
This code demonstrates the OLOO (Objects Linking to Other Objects) pattern: 1) It creates objects directly without constructor functions, 2) Uses Object.create() for explicit prototype linking, 3) Behavior is defined on a prototype object, not a function's prototype property, 4) Properties are added directly to the new object, 5) Maintains clean, direct prototypal inheritance without constructor/class abstractions, 6) Considered by many to be more aligned with JavaScript's prototype-based nature. This pattern focuses on object relationships rather than simulating classical inheritance.