
Company News
Socket Partners with Replit to Block Malicious Packages in AI-Powered Development
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.
@stdlib/array-base-any-has-property
Advanced tools
Test whether at least one element in a provided array has a specified property, either own or inherited.
We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.
The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.
When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.
To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!
Test whether at least one element in a provided array has a specified property, either own or inherited.
npm install @stdlib/array-base-any-has-property
var anyHasProp = require( '@stdlib/array-base-any-has-property' );
Tests whether at least one element in a provided array has a specified property, either own or inherited.
var o1 = {
'a': 1
};
var o2 = {
'b': 2
};
var o3 = {
'c': 3
};
var bool = anyHasProp( [ o1, o2, o3 ], 'b' );
// returns true
bool = anyHasProp( [ o1, o2, o3 ], 'd' );
// returns false
bool = anyHasProp( [ o1, o2, o3 ], 'toString' );
// returns true
var fromCodePoint = require( '@stdlib/string-from-code-point' );
var discreteUniform = require( '@stdlib/random-base-discrete-uniform' );
var filledBy = require( '@stdlib/array-filled-by' );
var anyHasProp = require( '@stdlib/array-base-any-has-property' );
function randomObject() {
var o = {};
o[ fromCodePoint( 97+discreteUniform( 0, 25 ) ) ] = 0;
return o;
}
var arr = filledBy( 10, 'generic', randomObject );
console.log( arr );
var bool = anyHasProp( arr, 'a' );
console.log( 'a: %s', bool );
bool = anyHasProp( arr, 'b' );
console.log( 'b: %s', bool );
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
See LICENSE.
Copyright © 2016-2026. The Stdlib Authors.
FAQs
Test whether at least one element in a provided array has a specified property, either own or inherited.
We found that @stdlib/array-base-any-has-property demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.

Research
/Security News
Newer packages in this compromise use native extensions and .pth loaders to execute JavaScript stealers in developer environments.