A singly linked list is a linear data structure where each element (node) contains a value and a pointer to the next node in the sequence.
class Node {
constructor(data) {
this.data = data;
this.next = null;
}
}
let head = new Node(10);
head.next = new Node(20);
head.next.next = new Node(30);