i looked at this challenge from codesignal (nthelementfromtheend) and put my code (below) in a test site

```
function nthElementFromTheEnd(l, n) {
if (n > l.length){
    return -1;
}else{

// console.log();
let index = l.length - n;
// console.log(index);
// console.log(l[index]);
return l[index];
}
}

let l = [1, 2, 3, 4];
let n=7;
nthElementFromTheEnd(l, n);

```

results seem to pass the test site, but not codesignal.

open links below in new tab

[challenge](https://app.codesignal.com/challenge/o9QW9r6JcBKqceGBq) 

[tester](https://www.webtoolkitonline.com/javascript-tester.html)

[array length](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length)