I think you need familiarize yourself with the following terms:
understand this, should help you answer part of the question, what you do not understand, you should be able to rephrase into a better question.
Feel free to google additional things which are unclear in the MDN documentation
um… I thought people would answer with a simple yes or no, then add to allow it to post wasn’t expecting the links
Can i be honest? Your question is phrased in such a way, that a simple yes or no answer isn’t possible
lets look at the documentation, the first line of Window documentation:
The window object represents a window containing a DOM document; the document property points to the DOM document loaded in that window.
So if we write html code:
<!DOCTYPE html> <html> <head> <title>hello</title> </head> <body> <p id="paragraph">hello world</p> </body> </html>
we can then save this file as html document, which has a dom tree, as explained here:
so all the different elements on the page are part of the DOM (document object model)
with JS we can get something from the document:
var example = document.getElementById("example")
see how we use
document here? It means we want to get something from the html document.
now look at console.log:
here we use
console. So we have
console, and we have
document we can get something from the webpage (or insert something), where as
console is something different entirely (its often used for debugging, all browsers ship with a console, just google how you can find and use it)
so we can use reactJS to manipulate the
document, which its used for
of course, if we need to debug during building our react app, we can add
console.log() to log additional information to the console which we do not want to display on the webpage
understanding what is what, and how the different pieces fit together can be tricky at first
oops… in my mind it looks like it’s phrased like a simple yes or no… I kinda understand… I always seem to forget that
console.log() is used for debugging, not logging to a webpage
log is a method belonging to console.
i am currently building a react app, i used console.log from time to time for debugging. But reactJS is mostly focusing on the webpage itself. (manipulating
lets do one attempt to answer this question: