Linked List

// Create a new linked list
var list = LinkedList()

var vals = ['0', '1', '2', '3', '4', '5', '6']

vals.forEach(val => {
    // Push each element of the vals array into the linked list
    list.push(val) 
})

// Insert element "7" at index 2
list.insertAt(2, "7")

// Remove the last element of the linked list
list.pop()

// Delete the element at the index possition passed
var x = list.delete(2) // Returns the deleted element

// Get the element at the index possition passed
var x = list.get(2) // Returns the element at the given index

console.log(x.isEmpty()) 
// returns true if there linked list is empty otherwise false

console.log(list.display()); // Print a string representation of the list