Daily Coding Challenge - Spiral Matrix

Tell us what’s happening:

While the test cases are good as they cover the rectangle use case.

They still miss a single-column/single-row test case.

Another thing that I’d like to report is that the system doesn’t print javascript errors in console. Please add this capability to print the error along with the current line number.

Your code so far

function spiralMatrix(matrix) {

    return matrix
}

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36

Challenge Information:

Daily Coding Challenge - Spiral Matrix

https://www.freecodecamp.org/learn/daily-coding-challenge/2026-04-12

Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.

wait, what do you mean that errors are not printed?

don’t you see this?

if the error is inside the function you may need to call the function to be able to see the error depending on the error