Console capture does not log when message is falsy
See original GitHub issueChallenge Passing Values to Functions with Arguments has an issue.
User Agent is: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36 OPR/41.0.2353.69
.
Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
// Example
// Only change code below this line.
function functionWithArgs(c, d) {
console.log(c + d);
}
functionWithArgs(7,-7); // result is 'console.log never called '
Result should be 0, but is not.
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
console.log does not output when running tests #2441 - GitHub
I would expect to have console.log always output while my tests are ... tests pass/fail properly - just console.log messages do not show...
Read more >Console.log statements output nothing at all in Jest
Run console.debug('Message here', yourValueHere) inside test function and it should show in the console output when running test script. You can ...
Read more >Capture Console Logs - LogRocket Docs
By default, all methods will be logged unless explicitly set to false. Disabling specific console logging methods. // This will log all console.info,...
Read more >JavaScript Console.log() Example – How to Print to the ...
If the first argument is false, then the message will be logged. If we were to change isItWorking to true , then the...
Read more >Logging and Trace - Liberty - IBM
The logging component does not capture or control the destination of messages that are written directly by the JVM process, such as -verbose:gc...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What’s interesting to me is that most of the following challenges (global scope challenge and the local scope challenge) don’t verify the message at all, nor stringify it. The message “console.log was never called” is never shown because of the seed, so it’s a bit weird that it even exists. I think it would be a good idea to make sure it’s consistent for all challenges where it is used, if that’s possible.
Ah! Your hunch is right 😃 @erictleung This line https://github.com/FreeCodeCamp/FreeCodeCamp/blob/staging/seed/challenges/01-front-end-development-certification/basic-javascript.json#L2358 should read
The
if
statement is unnecessary.When
message == 0
, it won’t output anything. 🙅♂️ according to https://github.com/FreeCodeCamp/FreeCodeCamp/blob/staging/seed/challenges/01-front-end-development-certification/basic-javascript.json#L2308