process.stdout and process.stderr differ from other Node.js streams in important ways:
- They are used internally by console.log() and console.error(), respectively.
Node.js docs
Array.isArray
и ещё сразу проверять идентичность длины и её наличие. const f = (a, b) => Array.isArray(a) && Array.isArray(b) && a.length === b.length && a.length > 0 ?
a.every((item, index) => f(item, b[index])) :
a === b;
console.log(f([0, 1, [3]], [0, 1, [3]]))