Code Monkey home page Code Monkey logo

enumerablejs's Introduction

Build Status Coverage Status GitHub issues

enumerablejs

REPOSITORY WILL BE ARCHIVED 03/01/2023

Due to the nature of this repository and my interest in it, I am officially archiving it. It was a good learning project a long time ago, that no longer gets any attention and needs to be sunset. To those of you who downloaded this code and used it, thank you for your support. :)

yarn

## install with yarn
$ yarn add asenumerable

npm

## install with npm
$ npm install asenumerable

Known Issues

In v1.3.0 require this module in node by using the following:

var Enumerable = require('asenumerable/dist/enumerable');

enumerablejs's People

Contributors

pilotgeraldb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

gitter-badger

enumerablejs's Issues

add .indexOf() method

add an indexOf method that takes in an object and returns its index within the collection

asEnumerable for strings

Since a string is an array of characters, it would helpful to provide the asEnumerable() extension method for strings as well. This method would create an array of characters via the following:

var arr = [];

for(var i = 0; i < str.length; i++)
{
    arr[i] = str.charAt(i);
}

You could then have access to any of the asEnumerable functions (any, count, select, where.. etc).

var str = "abcdef";
str.asEnumerable().dropLast(4);
//result: "ab"

After which it becomes necessary to seamlessly convert back to a string. This could be accomplished by overriding the toString() method of the array that is created when asEnumerable() is called.

var arr = ["a", "b"];
var result = arr.join('');
// result: "ab"

This would allow syntax like str.asEnumerable().dropLast(3).toString() ๐Ÿ˜„

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.