Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/namshi/js-array-into-object

Convert an array into an object (odd entries are keys, even entries are values)
https://github.com/namshi/js-array-into-object

Last synced: 1 day ago
JSON representation

Convert an array into an object (odd entries are keys, even entries are values)

Awesome Lists containing this project

README

        

# array-into-object

[![Build Status](https://travis-ci.com/namshi/js-array-into-object.svg?branch=master)](https://travis-ci.com/namshi/js-array-into-object)

Converts an array into an object -- where odd values are keys, and even values are
values.

Confused?

``` js
let a2o = require('array-into-object')

a2o([1, 2, 3, 4]) // {1: 2, 3: 4}
```