Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (9.5k points)

Can anyone tell me what’s the use of console.log in JavaScript? 

1 Answer

0 votes
by (19.7k points)

Console.log is a feature for debugging purposes. With this, you can log it to the console. 

It's not a jQuery feature but a feature for debugging purposes. You can for instance log something to the console when something happens. See the below code: 

$('#someButton').click(function() {

  console.log('#someButton was clicked');

  // do something

});

When you run the above code, you’ll see “#someButton was clicked” in Firebug’s “Console” tab. 

Interested in Java? Check out this Java Certification by Intellipaat.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...