bloody-inherit

inherit from an object

Usage no npm install needed!

<script type="module">
  import bloodyInherit from 'https://cdn.skypack.dev/bloody-inherit';
</script>

README

inherit

inherit from an object

browser support

Build Status

install

$ npm install bloody-inherit

require

var inherit = require("bloody-inherit")

api

inherit(proto) > object

creates an object that inherits from proto using prototypal inhertance (uses Object.create when available).

example

var proto = {
  value : 1
}
var object = inherit(proto)
object.value // 1
proto.value = 2
object.value // 2