1.0.0 • Published 5 years ago
curlysort v1.0.0
Curly-Sort
Installation
npm i curlysort
curlysort : Function takes two params
- first parameter is an array of objects
- second parameter is the key, if the key is not present in any element that the function will add that the element and assign null
- type of key must String
- if the type of the element is not an object(any of it), then it simply returns original array
example use case
arr = [
{
x:201
},
{
x:150
},
{
x:170
},
{
}
]
curlysort(arr,'x')
1.0.0
5 years ago