Singly linked list code bricks for JavaScript
npm install @aureooms/js-slljs-sll
==
Singly linked list code bricks for JavaScript. Parent is
aureooms/js-data-structures.
``js`
let head = sll.list( [ 9 , 2 , 5 ] ) ; // { next : Node , value : 9 }











Can be managed through jspm,
duo,
component,
bower,
ender,
jam,
spm,
and npm.
terminal
jspm install github:aureooms/js-sll
or
jspm install npm:@aureooms/js-sll
`
$3
No install step needed for duo!$3
`terminal
component install aureooms/js-sll
`$3
`terminal
bower install @aureooms/js-sll
`$3
`terminal
ender add @aureooms/js-sll
`$3
`terminal
jam install @aureooms/js-sll
`$3
`terminal
spm install @aureooms/js-sll --save
`$3
`terminal
npm install @aureooms/js-sll --save
`Require
$3
`js
let sll = require( "github:aureooms/js-sll" ) ;
// or
import sll from '@aureooms/js-sll' ;
`
$3
`js
let sll = require( "aureooms/js-sll" ) ;
`$3
`js
let sll = require( "@aureooms/js-sll" ) ;
`$3
The script tag exposes the global variable sll.
`html
`
Alternatively, you can use any tool mentioned here.$3
`js
require( [ "@aureooms/js-sll" ] , function ( sll ) { ... } ) ;
`Use
`js
let head = sll.list( [ 9 , 2 , 5 ] ) ; // { next : Node , value : 9 }head.value ; // 9
head.next.value ; // 2
head.next.next.value ; // 5
head.next.next.next ; // null
for ( let value of sll.iter( head ) ) {
// yields 9 then 2 then 5
}
``