Skip to content

PerjakaSunda/resorting-key

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Resorting Array By Object

Test Package

Install

npm install --save resorting-key

Usage

import ResortingKey from 'resorting-key';
const obj = [
    {
        data1: 'Sample1',
        data2: 'Sample data 2.1'
    },
    {
        data1: 'Sample2',
        data2: 'Sample data 2.2'
    },
    {
        data1: 'Sample3',
        data2: 'Sample data 3.3'
    }
]

console.log(ResortingKey(obj, 'data1'))

// {
//     result: {
//                 'Sample1': { data1: 'Sample1', data2: 'Sample data 2.1' },
//                 'Sample2': { data1: 'Sample2', data2: 'Sample data 2.2' },
//                 'Sample3': { data1: 'Sample3', data2: 'Sample data 3.3' }
//             },
//     length: 3
// }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published