Minor - Output neither captured nor used
See original GitHub issueDescribe your problem and how to reproduce it:
For Basic JavaScript: Selecting from Many Options with Switch Statements, its a bit weird that caseInSwitch(1);
is called but the output is not captured or used.
let result = caseInSwitch(1);
or
console.log(caseInSwitch(1)):
would be more typical.
See discussion here: https://www.freecodecamp.org/forum/t/basic-javascript-selecting-from-many-options-with-switch-statements-problem/404022/4
Add a Link to the page with the problem: https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/selecting-from-many-options-with-switch-statements
Tell us about your browser and operating system:
- Browser Name: Firefox
- Browser Version: 77.0.1
- Operating System: Arch Linux
If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
Output input from previous time step - Simulink - MathWorks
When the Memory block inherits a discrete sample time, the block is analogous to the Unit Delay block. However, the Memory block does...
Read more >Configure and Capture Embedded Packet on Software - Cisco
This document describes the Embedded Packet Capture (EPC) feature in Cisco IOS® software.
Read more >Input & output devices | AP CSP (article) - Khan Academy
There are hundreds of other input devices, like microphones to capture sound waves, ... Identify whether each accessory is a computer "input" or...
Read more >External Pacemaker - StatPearls - NCBI Bookshelf
External Pacing is the fastest available method to synchronize cardiac rhythm in all the bradyarrhythmias indicated by the American Heart ...
Read more >Input and Output - Computer Terminology
On either type of computer you can also use mice with three or more buttons and a small scroll wheel (which can also...
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
I think it’s a good idea to have the function call. It shows how the function is called and what arguments are passed to the function without having to look at the test cases.
But I agree it would be better to use the return value.
Wrapping function calls in console logs can confuse some new learners just a bit I think. Capturing the return and logging it is more verbose but also more explicit about the function having a return value and it allows for the use of a variable name that may help “document” the code.
Quite a while back we purposely removed most (I thought all) console.log statements that appeared after a function. The idea was if the user wanted use a console.log statement, then that was their choice. They do learn about them at some point in the curriculum. I believe we should not have console.log statements by default on these challenges until we have introduced them (Debugging section).