hasown
JavaScript curried hasOwn helper
Last updated 6 years ago by radubrehar .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install hasown 
SYNC missed versions from official npm registry.

hasown

JavaScript curried hasOwn helper.

Install

$ npm install hasown

Usage

Simple usage

var hasOwn = require('hasown')
var person = { name: 'bob' }

hasOwn(person, 'name') == true

Curried usage

var hasOwn = require('hasown')
var person = { lastName: 'willson' }
var child = Object.create(person)
child.age = 1
child.firstName = 'bob'

var childHasOwn = hasOwn(child)

for (var k in child) if (childHasOwn(k)){
    console.log(k, ' = ', child[k])
}

Test

$ make

Watch mode

$ make test-w

License

MIT

Current Tags

  • 1.0.1                                ...           latest (6 years ago)

1 Versions

  • 1.0.1                                ...           6 years ago

Copyright 2014 - 2016 © taobao.org |