has-in

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
798 B
Returns whether or not an object or its prototype chain has a property with the specified name
1 contributor
Install has-in as a package?
Copied
npm i @bit/justin-capalbo.ramda.has-in
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
hasIn (
prop:String,
obj:Object
) : Boolean

Returns whether or not an object or its prototype chain has a property with the specified name

Example
function Rectangle(width, height) {
       this.width = width;
       this.height = height;
     }
     Rectangle.prototype.area = function() {
       return this.width * this.height;
     };

     const square = new Rectangle(2, 2);
     R.hasIn('width', square);  //=> true
     R.hasIn('area', square);  //=> true
Arguments
prop: String

The name of the property to check for.

obj: Object

The object to query.

Returns
Boolean

Whether the property exists.

Help and resources