Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @ember/ordered-set with all npm packages installed. Try it out:

var orderedSet = require("@ember/ordered-set")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@ember/ordered-set v2.0.3

The default blueprint for ember-cli addons.

ember-ordered-set

npm Build Status

The OrderedSet class lets you store unique values of any type, whether primitive values or object references. It is mostly similar to the native Set class introduced in ES2015.

Installation

ember install @ember/ordered-set

Usage

After installing you can import OrderedSet from @ember/ordered-set:

import OrderedSet from '@ember/ordered-set';

The OrderedSet class has mostly the same API as the native Set class with a few differences:

  • The constructor does not take any arguments
  • A static create() method exists for symmetry with Ember.Object
  • A static length property does not exist on OrderedSet
  • OrderedSet has an isEmpty() method
  • There are no entries(), keys() and values() methods, but there is a toArray() method instead
  • The @@iterator symbol is not defined
  • OrderedSet has a copy() method

License

ember-ordered-set is licensed under the MIT License.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free