Codota Logo For Javascript
Array.values
Code IndexAdd Codota to your IDE (free)

How to use
values
function
in
Array

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

origin: o2team/athena

// 用来给字体指定唯一标识
// 字体的 ID 根据 font-family 以及其他 font-* 属性来生成
// @see https://github.com/aui/font-spider/issues/32
function getFontId (name, options) {

  var values = getFontId.keys.map(function (key, index) {

    var value = options[key] || getFontId.values[index];

    if (typeof value !== 'string') {
      value = getFontId.values[index];
    } else if (getFontId.alias[key]) {
      value = value.replace.apply(value, getFontId.alias[key]);
    }

    return value;
  });

  values.unshift(name);

  var id = values.join('-');
  id = crypto.createHash('md5').update(id).digest('hex');

  return id;
}
origin: Financial-Times/polyfill-library

it('returns a next-able object', function () {
  var array = ['val1', 'val2'];
  var iterator = array.values();

  proclaim.isInstanceOf(iterator.next, Function);
  proclaim.deepEqual(iterator.next(), {
    value: 'val1',
    done: false
  });
});
origin: koalanlp/nodejs-support

/**
   * @see Array#values
   * @returns {Iterator.<T>}
   */
  values(){
    return this._items.values();
  }
origin: koalanlp/nodejs-support

describe('DependencyTag', () => {
      it('discriminate tags', () => {
        let values = DependencyTag.values();
        let codes = values.map((c) => c.tagname);

        _.range(100).forEach(() => {
          let filtered = codes.filter(() => _.random(0, 1) == 1);
          for (const tag of values) {
            expect(Util.contains(filtered, tag)).toBe(filtered.includes(tag.tagname));
          }
        });

        for (const code of codes) {
          expect(DependencyTag.withName(code)).toBe(DependencyTag[code]);
        }
      });
    });
origin: Financial-Times/polyfill-library

/* globals proclaim, Symbol */

it('is an alias to Array.prototype.values', function () {
  proclaim.deepEqual(Array.prototype[Symbol.iterator], Array.prototype.values);
});
origin: visgl/loaders.gl

/**
  * @param {Uint8Array[]} chunks
  */
 constructor(chunks) {
  // @ts-ignore
  super(new BlobStreamController(chunks.values()), {type: 'bytes'});
  /** @private */
  this._chunks = chunks;
 }
origin: koalanlp/nodejs-support

expect(
    POS.values().every((tag) => jsmorph.hasTag(tag.tagname) === jsmorph.reference.hasTag(tag.tagname))
  ).toBe(true);
origin: Financial-Times/polyfill-library

it('has correct name', function () {
  try {
    proclaim.hasName(Array.prototype.values, 'values');
  } catch (e) {
    // Chrome 40 implements the Symbol.iterator function for Arrays but has it named ArrayValues.
    try {
      proclaim.equal([].values.name, 'ArrayValues');
    } catch (er) {
      // Firefox 44 has it named [Symbol.iterator].
      proclaim.equal([].values.name, '[Symbol.iterator]');
    }
  }
});
origin: adam-cowley/neode

/**
   * Iterator
   */
  [Symbol.iterator]() {
    return this._values.values();
  }
origin: Financial-Times/polyfill-library

/* globals proclaim */

it('is a function', function () {
  proclaim.isFunction(Array.prototype.values);
});
origin: electricmonk/goos-nodejs

columns() {
    return Column.values;
  }
origin: gerardobort/node-corenlp

[Symbol.iterator]() {
  return this._tokens.values();
 }
origin: Financial-Times/polyfill-library

it('has correct arity', function () {
  proclaim.arity(Array.prototype.values, 0);
});
origin: Financial-Times/polyfill-library

it('finally returns a done object', function () {
  var array = ['val1', 'val2'];
  var iterator = array.values();
  iterator.next();
  iterator.next();
  proclaim.deepEqual(iterator.next(), {
    value: undefined,
    done: true
  });
});
origin: koalanlp/nodejs-support

describe('CoarseEntityType', () => {
      it('discriminate tags', () => {
        let values = CoarseEntityType.values();
        let codes = values.map((c) => c.tagname);

        _.range(100).forEach(() => {
          let filtered = codes.filter(() => _.random(0, 1) == 1);
          for (const tag of values) {
            expect(Util.contains(filtered, tag)).toBe(filtered.includes(tag.tagname));
          }
        });

        for (const code of codes) {
          expect(CoarseEntityType.withName(code)).toBe(CoarseEntityType[code]);
        }
      });
    });
builtins(MDN)Arrayvalues

JSDoc

Returns an iterable of values in the 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

  • aws-sdk
    AWS SDK for JavaScript
  • through2
    A tiny wrapper around Node.js streams.Transform (Streams2/3) to avoid explicit subclassing noise
  • request
    Simplified HTTP request client.
  • chalk
    Terminal string styling done right
  • commander
    the complete solution for node.js command-line programs
  • redis
    Redis client library
  • webpack
    Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
  • handlebars
    Handlebars provides the power necessary to let you build semantic templates effectively with no frustration
  • ms
    Tiny millisecond conversion utility
  • Top plugins for WebStorm
    The challenge is finding the best plugins for JavaScript development on Intellij IDEs. Who wants to sit there and go over hundreds of plugins to pick the best?
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJavascript Code Index
Get Codota for your IDE now