Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console log does not accept rest params! #9

Open
senseijames opened this issue Oct 7, 2019 · 1 comment
Open

Console log does not accept rest params! #9

senseijames opened this issue Oct 7, 2019 · 1 comment

Comments

@senseijames
Copy link

senseijames commented Oct 7, 2019

If you have something like this:

console.log('one', 'two', 'three');

you will only see

one

logged to the console. You'll need to manually wrap the params in an Array and join, like so:

console.log([ 'one', 'two', 'three' ].join(' '));

to see the expected output.

(Note I referenced this on StackOverflow in hopes that it might get some play.)

@CTimmerman
Copy link

CTimmerman commented Apr 16, 2022

original_log = console.log
function foo() { original_log(...arguments) }
console.log = foo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants