Hope this is not to silly of a question

I am on, and just passed Basic JavaScript: Word Blanks.
Line 9 says Change the words here to test your function

  1. wordBlanks(“dog”, “big”, “ran”, “quickly”); The problem is though it passes change the words or not I see nothing just this below. How do I actually see the changes.
    Thanks, gabe.

/**

  • Your test output will go here.

*/

Not silly at all. You really don’t get to see the result of your code, simply watch the test run. But you can see it, if you change it a little.

First, I assume the lesson you’re referring to is the “Word Blanks” one here: https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/word-blanks/

The guidelines I’ll give work, not only here, but in every lesson. Also, they’re commonly used “debugging tools”.

  1. (less recommended) use an alert. Add the line alert(result); before you return result;, and it’ll pop up a dialog alerting you with the content of that result variable. This is less than ideal, as in a production development, you’d have to go through and remove all those pesky alert() calls, or it’ll keep showing folks all your oopses.
  2. (preferred) Use the console. Most modern browsers include some sort of developer tools, and in there, there’s a Console. Again, just before you return result; you can send the contents of the result variable to that console by console.log(result);.

In Chrome, ctrl-alt-J will open the console. Watch in there when you run your script, and you should see the contents of result appear there, with nothing displayed elsewhere in the browser.

There are a number of cool console options: console.log(...), console.info(...), console.warn(...), console.error(...) and console.time(...) to name a few. For different situations, it makes sense to use different options. For what you want, though, console.log() will do nicely.

Thank you once again.
That is very cool, and helpful.
And very much appreciated.

Glad to help.

And for the record, the Console is not the only cool bit in the Developer Tools. Most of them have an Inspect or an Elements tab, that will allow you to actually view and edit the HTML and CSS of a page.

So, for example, when you’re doing the Responsive Web Design challenges, get your HTML looking good, then you can go into the Elements pane (in Chrome) and start seeing the effect of specific CSS changes to that HTML. Is very cool, imo.

1 Like