How can we replicate Python's print-like behavior using console.log in JavaScript?

You can use template literals to format the output similar to Python’s print behavior.

console.log(`${[1, 2]}\n${[3, 4]}`);

Output:

1,2 3,4