src/lib/collections/linked-list.js
function (value) {
        var node;

        if (value instanceof LinkedListNode) {
            node = value;
            validateNode(node, null);

            if (this.head === null) {
                this.insertNodeToEmptyList(node);
            }
            else {
                this.insertNodeBefore(this.head, node);
                this.head = node;
            }
        }
        else {
            node = new LinkedListNode(value);
            this.addFirst(node);
        }

        return node;
    }
function (value) {
        var node;

        if (value instanceof LinkedListNode) {
            node = value;
            validateNode(node, null);

            if (this.head === null) {
                this.insertNodeToEmptyList(node);
            }
            else {
                this.insertNodeBefore(this.head, node);
                this.head = node;
            }
        }
        else {
            node = new LinkedListNode(value);
            this.addFirst(node);
        }

        return node;
    }
function ( value ) { var node ; if ( value instanceof LinkedListNode ) { node = value ; validateNode ( node , null ) ; if ( this . head === null ) { this . insertNodeToEmptyList ( node ) ; } else { this . insertNodeBefore ( this . head , node ) ; this . head = node ; } } else { node = new LinkedListNode ( value ) ; this . addFirst ( node ) ; } return node ; }
Adds the specified new node at the start of the LinkedList.
@param {LinkedListNode|Object} value The value or the LinkedListNode to add at the start of the LinkedList.
@returns {LinkedListNode}
Adds the specified new node at the start of the LinkedList .