Skip to content

hinn254/ArrayToObject-npm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SIMPLE ARRAY TO OBJECT MAPPER

Installation

  • Using npm: npm i @benny-otieno/array-to-object
  • Using Yarn: yarn add @benny-otieno/array-to-object

Example

The first argument is the key array and the second argument is the values

const arrayToObject = require("array-to-object");


arrayToObject(["name", "height"], ["Benny", "1.7m"])

result // { name: 'Benny', height: '1.7m' }



arrayToObject(["fruits", "expenses"], [["apples","bananas"], ["rent","transport"]])

result // { fruits: [ 'apples', 'bananas' ], expenses: [ 'rent', 'transport' ] }

License

Author

Feel free to ask me questions on Twitter @CodeManyatta!

Contributors

Feel free to add more features or raise PR's for improvemts. I welcome collaborations.

About

This is a npm package that converts two arrays into one object.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published