skip to Main Content

I simply create a script.js and connect it with index.html
In script.js i write console("Hello World from js");

I want to see the console statement Hello World from js in the browser console. So I go to Console, RC>Inspect>Console,
Browser Console Output
There i get an errorenter image description here

Could anybody help me with this issue?

I want to see a clear output Hello World from js in Browser Console

2

Answers


  1. I think you meant to write console.log('hello world').

    Login or Signup to reply.
  2. You cannot use just console, you need to specify a function like log, warn, error, etc.

    console.log("The Program works");
    //Logs to console
    
    console.info("The user is running Firefox")
    //A message to inform
    
    console.debug("Some debugging message")
    //Used to debug a program
    
    console.warn("Some warning message");
    //Warns of something not right
    
    console.error("Error: Something has gone wrong");
    //Something has failed
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search