Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class List {
- constructor() {
- this.head = null
- this.tail = null
- }
- push(head) {
- this.head = head
- this.tail = new List()
- }
- }
- const list1 = new List()
- list1.push(5)
- console.log(list1)
- if(head = 5){
- list1.push(6)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement