Output console unresponsive

Hi. I’m around 60th question on javascript basics. Output console doesn’t work. it says error whenever I’m doing something wrong but I can’t see output what I’m doing. Several of tasks had something like console log but I can’t implement it myself (error in console) and it seems like it should be showing me what I’m doing. I can click “run tests” and I passed but I can’t play with it and see result of what I’m doing. Firefox/chrome/ubuntu/windows. I’ve checked and it’s all the same.

Hi @majeszko1 !

Welcome to the forum!

It would help if you can post the challenge link so we know which lesson you are working on.

Also, please post your code here.

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

Hi. Thanks for quick reply. The issue isn’t with the code itself. I’m newby here so be aware of that. But in the meantime I copy/pasted your code here - https://jsconsole.com/ and whenever I click return I can see what I’m actually doing. This is what was hapening on html cource fcc. So I’m assuming the idea is the same. I can pass the tests but I cant see the result of what I’m doing.
Example: Java basics around 65th task -
Comparison with the Strict Inequality Operator
My code. I passed.

function testStrictNotEqual(val) {
  if (val !== 17) { 
    return "Not Equal";
  }
  return "Equal";
}

testStrictNotEqual(10);

So my understanding is and I can do this on the console I sent you link to that I can click enter and see “equal” or “not equal” as outcome. All your console shows is
/**

  • Your test output will go here
    */

Or error message when I click “run the tests”
// running tests

testStrictNotEqual(17)

should return the string

Equal
testStrictNotEqual(12)

should return the string

Not Equal
testStrictNotEqual("bob")

should return the string

Not Equal

You should use the

!==

operator // tests completed

I can’t see what I’m actually doing!!!

When I add a console.log at the end of your code I get this result in the console.

function testStrictNotEqual(val) {
  if (val !== 17) { 
    return "Not Equal";
  }
  return "Equal";
}

testStrictNotEqual(10);
console.log(testStrictNotEqual(10))

I get the same result in js console without using the console.log
Screen Shot 2021-10-23 at 8.40.52 AM

I am not getting an error message on my end.
So maybe the issue was where you placed the console.log?

I would try adding the console.log at the end of your code like I showed you.

Hope that helps!

// you want to log your code in console then you can do this using console.log()

//  for example
function sum(no,no2){
        if(no2 == 10){
            console.log( no + no2);
        }else{
            console.log(no - no2)
        }
    }
    sum(12,20);  // i get output in console -8

OK!!!
I wasn’t using console.log correctly.
Thanks for clearing that up.
This wasn’t explain and I’m new to this.
From my point of view it would have been big improvement if you would
explain very clearly how to use console.log or even better - guy in “get help” videos have “run” button. In my opinion this could have been massive improvement. Thank you very much again.

I think the new all project based curriculum introduces console.log earlier.
So that should probably help campers :grinning:

If I remember correctly, I think console.log doesn’t come up in this current curriculum until the debugging section.

console.log( ) is just way to print your output in console in javascript.
you can also use document.write( ) to get your output in document. and there are other method too but lets talk about console

console.log('hello world my name is rio'); you will get your text in console
open console in your browser to see ouput

to open console in your browser simple go to your browser and left click your mouse then click on inspect then choose console .there is your console .
and now your can write same code in your console
console.log('hello world my name is yourname'); // you will see output there