Skip to content

A modern User-friendly array which supports stack Operations. This helps you to handle and modify arrays nice and easily

License

Notifications You must be signed in to change notification settings

Tibinsunny/modernarray

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modernarray

A modern User-friendly array which supports stack Operations. This helps you to handle and modify arrays nice and easily

Install

npm install modernarray

Usage and Example

let modernarray = require('modernarray');
let myArray=[{
    name:"Joe Deo",
    status:false
},
{
    name:"Bob Painter",
    status:true
}]
// Array can also be let modernarray = [1,2,3,4,5,6,7,8]
let outputArray = modernarray.popByIndex(myArray,1)
/* Output Array will just have 
[{
    name:"Joe Deo",
    status:false
}]
Array at index 1 is Removed
*/
let outputArray2 = modernarray.popByValue(myArray,{status:false})
/* Output Array will just have 
[{
    name:"Bob Painter",
    status:true
}]
Array element with status "false" is removed 
*/
let outputArray3 = modernarray.pushToIndex(myArray,1,{name:"John Bell",status:true})

/* Output Array will  have 
[
  { name: 'Joe Deo', status: false },
  { name: 'John Bell', status: true },
  { name: 'Bob Painter', status: true }
]
New Element is added
*/

Supported Function

  • popByIndex(array,index)
  • popByValue(array,value)
  • pushToIndex(array,index,value)

About

A modern User-friendly array which supports stack Operations. This helps you to handle and modify arrays nice and easily

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published