GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - HowProgrammingWorks/Mixin: Mixin behavior, structure and relations

BranchesTags
Open more actions menu

Latest commit

 

History

40 Commits
40 Commits

Folders and files

NameName
Last commit message
Last commit date
JavaScript
JavaScript
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
eslint.config.js
eslint.config.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
prettier.config.js
prettier.config.js
 
 

Repository files navigation

Примеси в JavaScript

Примеси в JavaScript: mixin, extend, Object.assign, class λ-mixin

Tasks:

  • see examples
  • implement extend(obj, ...objects) so keys from objects will be mixed into obj only if it doesn't contain those keys
  • implement wrap(obj, ...funcs) so if obj contains func.name it should be wrapped
  • implement mixin logable()
  • implement universal equilateral mixin for for N sides (see 6-class.js)
  • implement emitable with Object.defineProperty (see 6-evants.js)
  • implement mixin for prototypes (not instances)
  • implement extend for mixins with additional override:Boolean flag
const mix2 = [
  {
    override: true,
    toString() {
      return `${this.name} - ${this.city} - ${this.born}`;
    }
  },
  {
    override: false,
    age() {
      const year = new Date().getFullYear();
      const born = new Date(this.born).getFullYear();
      return year - born;
    }
  }
];

extend(obj1, mix1, mix2);

About

Mixin behavior, structure and relations

www.youtube.com/TimurShemsedinov

Topics

javascriptjsmixmixinnodenodejsobject-assign

Resources

Readme
MIT license
Activity
Custom properties

Stars

7 stars

Watchers

17 watching

Forks

20 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.