Tabnine Logo For Javascript
Array.some
Code IndexAdd Tabnine to your IDE (free)

How to use
some
function
in
Array

Best JavaScript code snippets using builtins.Array.some(Showing top 15 results out of 5,508)

origin: strapi/strapi

const doesComponentHaveAComponentField = component => {
 const attributes = get(component, ['schema', 'attributes'], {});

 return Object.keys(attributes).some(attributeName => {
  const type = get(attributes, [attributeName, 'type'], '');

  return type === 'component';
 });
}
origin: Automattic/wp-calypso

/**
 * Are tracking pixels forbidden from the given URL for better performance (except for Google Analytics)?
 *
 * @returns {boolean} true if the current URL is excluded.
 */
export default function isUrlExcludedForPerformance() {
  const { href } = document.location;
  const match = ( pattern ) => href.indexOf( pattern ) !== -1;
  const result = excludedRoutes.some( match );

  debug( `Is URL Excluded for Performance: ${ result }` );
  return result;
}
origin: Automattic/wp-calypso

/**
 * Determines if a path is a legacy route, and should be ignored by Calypso
 *
 * @param path The path to check
 * @returns True if legacy path, false otherwise
 */
export function isLegacyRoute( path: URLString ): boolean {
  return legacyRoutes.some(
    ( { match, noMatch = { test: () => false }, predicate = () => true } ) =>
      predicate( path ) && match.test( path ) && ! noMatch.test( path )
  );
}
origin: Automattic/wp-calypso

/**
 * Whether the current URL can potentially contain personally identifiable info.
 *
 * @returns {boolean} true if the current URL can potentially contain personally identifiable info.
 */
export default function isPiiUrl() {
  const href = document.location.href;
  const match = ( pattern ) => href.indexOf( pattern ) !== -1;
  const result = forbiddenPiiPatterns.some( match ) || forbiddenPiiPatternsEnc.some( match );

  debug( `Is PII URL: ${ result }` );
  return result;
}
origin: strapi/strapi

const isPermissionEnabled = (permission, role) =>
 DEFAULT_PERMISSIONS.some(
  defaultPerm =>
   (defaultPerm.action === null || permission.action === defaultPerm.action) &&
   (defaultPerm.controller === null || permission.controller === defaultPerm.controller) &&
   (defaultPerm.type === null || permission.type === defaultPerm.type) &&
   (defaultPerm.roleType === null || role.type === defaultPerm.roleType)
 )
origin: enquirer/enquirer

isSelected(choice) {
  if (Array.isArray(this.initial)) {
   return this.initial.some(value => this.isChoice(choice, value));
  }
  return this.isChoice(choice, this.initial);
 }
origin: Flood-UI/flood

verifyDependencies() {
  const isDependencyLoading = Object.keys(this.dependencies).some(id => this.dependencies[id].satisfied === false);

  if (!isDependencyLoading) {
   this.haveUIDependenciesResolved = true;
   this.emit(EventTypes.UI_DEPENDENCIES_LOADED);
  }
 }
origin: enquirer/enquirer

isDisabled(choice = this.focused) {
  let keys = ['disabled', 'collapsed', 'hidden', 'completing', 'readonly'];
  if (choice && keys.some(key => choice[key] === true)) {
   return true;
  }
  return choice && choice.role === 'heading';
 }
origin: gpujs/gpu.js

/**
  * @desc TRUE if platform supports single precision}
  * @returns {boolean}
  */
 static get isSinglePrecisionSupported() {
  return kernelOrder.some(Kernel => Kernel.isSupported && Kernel.features.isFloatRead && Kernel.features.isTextureFloat);
 }
origin: strapi/strapi

useCallback(
  dzName => {
   const doesDZHaveError = Object.keys(formErrors).some(key => key.split('.')[0] === dzName);
   const shouldCheckErrors = !isEmpty(formErrors) && doesDZHaveError;

   return shouldCheckErrors;
  },
  [formErrors]
 )
origin: avwo/whistle

Object.keys(data).some(function(name) {
  var item = data[name];
  return item && item.changed;
 })
origin: gpujs/gpu.js

/**
  *
  * @returns {boolean}
  */
 static get isKernelMapSupported() {
  return kernelOrder.some(Kernel => Kernel.isSupported && Kernel.features.kernelMap);
 }
origin: strapi/strapi

const isPermissionEnabled = (permission, role) =>
 DEFAULT_PERMISSIONS.some(
  defaultPerm =>
   (defaultPerm.action === null || permission.action === defaultPerm.action) &&
   (defaultPerm.controller === null || permission.controller === defaultPerm.controller) &&
   (defaultPerm.type === null || permission.type === defaultPerm.type) &&
   (defaultPerm.roleType === null || role.type === defaultPerm.roleType)
 )
origin: strapi/strapi

useCallback(
  dzName => {
   const doesDZHaveError = Object.keys(formErrors).some(key => key.split('.')[0] === dzName);
   const shouldCheckErrors = !isEmpty(formErrors) && doesDZHaveError;

   return shouldCheckErrors;
  },
  [formErrors]
 )
origin: strapi/strapi

const doesComponentHaveAComponentField = component => {
 const attributes = get(component, ['schema', 'attributes'], {});

 return Object.keys(attributes).some(attributeName => {
  const type = get(attributes, [attributeName, 'type'], '');

  return type === 'component';
 });
}
builtins(MDN)Arraysome

JSDoc

Determines whether the specified callback function returns true for any element of an array.

Most used builtins functions

  • Console.log
  • Console.error
  • Promise.then
    Attaches callbacks for the resolution and/or rejection of the Promise.
  • Promise.catch
    Attaches a callback for only the rejection of the Promise.
  • Array.push
    Appends new elements to an array, and returns the new length of the array.
  • Array.length,
  • Array.map,
  • String.indexOf,
  • fetch,
  • Window.location,
  • Window.addEventListener,
  • ObjectConstructor.keys,
  • Array.forEach,
  • Location.reload,
  • Response.status,
  • Navigator.serviceWorker,
  • ServiceWorkerContainer.register,
  • ServiceWorkerRegistration.installing,
  • ServiceWorkerContainer.controller

Popular in JavaScript

  • superagent
    elegant & feature rich browser / node HTTP with a fluent API
  • readable-stream
    Streams3, a user-land copy of the stream library from Node.js
  • commander
    the complete solution for node.js command-line programs
  • fs
  • postcss
  • body-parser
    Node.js body parsing middleware
  • minimatch
    a glob matcher in javascript
  • through2
    A tiny wrapper around Node.js streams.Transform (Streams2/3) to avoid explicit subclassing noise
  • debug
    small debugging utility
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now