Leetcode doesnt seem to take my answer on Rotate Array

This answer is with regards to the question on Rotate Array on leetcode (array-646). The answer should be [5,6,7,1,2,3,4] and when I console.log(ans) I get the same thing in vscode. However, when I post it on leetcode it doesn't understand my answer. It keeps saying your answer is [1,2,3,4,5,6,7]. How do I change it so it understands my answer?

const k = 3;
const nums = [1, 2, 3, 4, 5, 6, 7];

var rotate = function (nums, k) {
  var FN = [];
  var LN = [];
  for (i = 0; i < nums.length - k; i++) {
    FN.push(nums[i]);
  }
  console.log("FN:", FN);

  for (j = k; j > 0; j--) {
    LN.push(nums[nums.length - j]);
  }
  console.log("LN:", LN);

  const ans = [].concat(LN, FN);
  console.log(ans);
}

It looks like you mean this exercise. The short description is:

Given an array, rotate the array to the right by k steps, where k is non-negative.

Note the comments in the template they've provided:

/**
 * @param {number[]} nums
 * @param {number} k
 * @return {void} Do not return anything, modify nums in-place instead.
 */
var rotate = function(nums, k) {
    
};

It sounds like leetcode is expecting you to change the contents of the array that you're given. Instead, you're creating a new array. If you output the array after calling your method, you can see that it's still giving [1, 2, 3, 4, 5, 6, 7], like leetcode is reporting.

const k = 3;
const nums = [1, 2, 3, 4, 5, 6, 7];

var rotate = function (nums, k) {
  var FN = [];
  var LN = [];
  for (i = 0; i < nums.length - k; i++) {
    FN.push(nums[i]);
  }
  console.log("FN:", FN);

  for (j = k; j > 0; j--) {
    LN.push(nums[nums.length - j]);
  }
  console.log("LN:", LN);

  const ans = [].concat(LN, FN);
  console.log(ans);
}

rotate(nums, k);
console.log(nums);

How do I change it so it understands my answer?

I'm not sure how much detail you want here: you still want it to be your answer, after all. In broad terms, you need to change your function so that it alters the nums array that was passed into it, to have the same series of numbers that you have in your ans const.