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

How to use
each
function
in
Array

Best JavaScript code snippets using builtins.Array.each(Showing top 12 results out of 315)

origin: lando/lando

const urls = ['http://www.thecultofscottbakula.com', 'http://anumalak.com:'];
return scan(urls)
 .each(result => {
  result.status.should.be.true;
  result.color.should.equal('green');
const urls = ['http://thecultofscottbakula.com:503', 'http://anumalak.com:503'];
return scan(urls)
 .each(result => {
  result.status.should.be.true;
  result.color.should.equal('green');
const urls = ['http://*.thecultofscottbakula.com', 'http://*.anumalak.com:'];
return scan(urls)
 .each(result => {
  result.status.should.be.true;
  result.color.should.equal('yellow');
const urls = ['http://thecultofscottbakula.com.666', 'http://anumalak.com.404'];
return scan(urls, {max: 1, waitCodes: [666, 404]})
 .each(result => {
  result.status.should.be.false;
  result.color.should.equal('red');
const urls = ['http://thecultofscottbakula.com.666:2'];
return scan(urls, {max: 2, waitCodes: [666]})
 .each(result => {
  result.status.should.be.true;
  result.color.should.equal('green');
origin: v8/web-tooling-benchmark

(function(math){

var methods = {};

math.each(function(name){
  if (!Number[name]) methods[name] = function(){
    return Math[name].apply(null, [this].concat(Array.convert(arguments)));
  };
});

Number.implement(methods);

})(['abs', 'acos', 'asin', 'atan', 'atan2', 'ceil', 'cos', 'exp', 'floor', 'log', 'max', 'min', 'pow', 'sin', 'sqrt', 'tan']);
origin: postmanlabs/postman-sandbox

function iterateOverSparseArray(arr, fn, fromIndex, loop) {
  var indexes = [], i;
  for(i in arr) {
   if(isArrayIndex(arr, i) && i >= fromIndex) {
    indexes.push(parseInt(i));
   }
  }
  indexes.sort().each(function(index) {
   return fn.call(arr, arr[index], index, arr);
  });
  return arr;
 }
origin: v8/web-tooling-benchmark

var svgCalculateSize = function(el){

  var gCS = window.getComputedStyle(el),
    bounds = {x: 0, y: 0};

  heightComponents.each(function(css){
    bounds.y += parseFloat(gCS[css]);
  });
  widthComponents.each(function(css){
    bounds.x += parseFloat(gCS[css]);
  });
  return bounds;
}
origin: bytedance/diat

groups.each(typeof value === "function"
   ? function(d, i, j) { groups[j][i].duration = Math.max(1, value.apply(this, arguments) | 0); }
   : (value = Math.max(1, value | 0), function(d, i, j) { groups[j][i].duration = value; }))
origin: ospfranco/link-preview-js

nodes.each((_: number, node: any) => {
 src = node.attribs.href;
 if (src) {
origin: anhthii/Echo

this.elements.each((index, element) => {
  const doc = {};
  const selectors = Object.keys(this.attrs);
  selectors.forEach(selector => {
   if (hasOwnProperty(this.attrs, selector)) {
    const arr = this.attrs[selector];
    const $el = this.$(element).find(selector);
    arr.forEach(obj => {
     const { attr, outputKey, manipulateFunc } = obj;
     if (outputKey === 'id' || outputKey === 'alias') {
      // get the song id and alias
      const match = /\/([0-9A-Za-z_-]+)\/(\w+)\.html$/.exec(this.attr($el, attr));
      const [, alias, id] = match;
      doc[outputKey] = outputKey === 'id' ? id : alias;
     } else {
      doc[outputKey] = this.attr($el, attr, manipulateFunc);
     }
    });
   }
  });
  this.result[this.key].push(doc);
 });
origin: xpl/useless

(function () { var colors = _.keys (_.omit (log.color, 'none'))
          colors.each (Meta.globalTag)
origin: v8/web-tooling-benchmark

  if ((/^(height|width)$/).test(property) && !(/px$/.test(result))){
    var values = (property == 'width') ? ['left', 'right'] : ['top', 'bottom'], size = 0;
    values.each(function(value){
      size += this.getStyle('border-' + value + '-width').toInt() + this.getStyle('padding-' + value).toInt();
    }, this);
Array.flatten(arguments).each(function(key){
  result[key] = this.getStyle(key);
}, this);
origin: bytedance/diat

groups.each(typeof value === "function"
   ? function(d, i, j) { groups[j][i].delay = value.apply(this, arguments) | 0; }
   : (value = value | 0, function(d, i, j) { groups[j][i].delay = value; }))
origin: xiugangzhang/video.github.io

    res = [];
  doms.each(function () {
    if (this.className === className) {
args.each(function () {
      if (context.length) {
        context.each(function () {
          pushArray(self.$class(selector, this));
        });
      if (context.length) {
        context.each(function () {
    [].slice.call(doms).each(function () {
      res.push(this);
    });
arr.each(function () {
args.each(function () {
    doms.each(function () {
      ret.push(this);
    });
origin: ospfranco/link-preview-js

// returns an array of URL's to favicon images
function getFavicons(doc, rootUrl) {
  var images = [];
  var nodes = [];
  var src;
  var relSelectors = [
    "rel=icon",
    "rel=\"shortcut icon\"",
    "rel=apple-touch-icon",
  ];
  relSelectors.forEach(function (relSelector) {
    // look for all icon tags
    nodes = doc("link[" + relSelector + "]");
    // collect all images from icon tags
    if (nodes.length) {
      nodes.each(function (_, node) {
        src = node.attribs.href;
        if (src) {
          src = url_1.default.resolve(rootUrl, src);
          images.push(src);
        }
      });
    }
  });
  // if no icon images, use default favicon location
  if (images.length <= 0) {
    images.push(getDefaultFavicon(rootUrl));
  }
  return images;
}
builtins(MDN)Arrayeach

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

  • js-yaml
    YAML 1.2 parser and serializer
  • q
    A library for promises (CommonJS/Promises/A,B,D)
  • qs
    A querystring parser that supports nesting and arrays, with a depth limit
  • mkdirp
    Recursively mkdir, like `mkdir -p`
  • fs
  • node-fetch
    A light-weight module that brings window.fetch to node.js
  • axios
    Promise based HTTP client for the browser and node.js
  • lodash
    Lodash modular utilities.
  • http
  • Top Vim 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