Is this correct for reversing a linkedlist?

You are not supplying a linked list to your function. You have supplied an array.

I tried looking up how to define a linked list. can you hint me ?

A very basic linked list would be:

function LinkedList() {
  let length = 0;
  let head = null;

  function Node(element) {
    this.element = element;
    this.next = null;
  }

  this.head = () => head;

  this.size = () => length;

  this.add = element => {
    const node = new Node(element);
    if (head) {
      let current = head;
      while (current.next !== null) {
        current = current.next;
      }
      current.next = node;
    }
    else {
      head = node;
    }
    length++;
  };
}

const myList = new LinkedList();
myList.add('a');
myList.add('b');
myList.add('c');
console.log(JSON.stringify(myList.head(), null, 2));

The above would display the following in the console:

{
  "element": "a",
  "next": {
    "element": "b",
    "next": {
      "element": "c",
      "next": null
    }
  }
}

I was hoping it would be a simple variable definition