Skip to content
Advertisement

Tag: console.log

Console.log from a class’ function

I want to test if my function inside my class returns the given sentence. But if I try to test using console.log, it returns ReferenceError: rev is not defined. What am I doing wrong? I’m a fairly new programmer, so bear with me if this is a stupid question. Answer The entire point of a class is to provide a

Call JavaScript function from another JavaScript file

In the first.js file, I want to call the functions from second.js: This is second.js file: Answer tl;dr: Load your dependencies before you depend on them. You can’t call a function that hasn’t been loaded. The functions defined in your second JS file won’t be loaded until the first file has finished running all the top-level statements. Reverse the order

Remove index from console.table()

I am viewing an array of data in the console. console.table(myArray) always has the index as the first column. This is fine when viewing object data, when the index is the key, but not when the index is the array index (in my case it is distracting/ annoying/ takes away from the content). Is there any way to show the

What is console.log?

What is the use of console.log? Please explain how to use it in JavaScript, with a code example. Answer It’s not a jQuery feature but a feature for debugging purposes. You can for instance log something to the console when something happens. For instance: You’d then see #someButton was clicked in Firebug’s “Console” tab (or another tool’s console — e.g.

Advertisement