Console.log & return

What is the different between console.log and return

Type your question above this line.



So console.log allows a developer to print messages in the console of the browser. Like the error shown below.

Now whenever the author is talking about return you can safely assume they are talking about the return syntax from JavaScript. A function can return any data type.

So for example in

var paragraphs = document.getElementsByTagName('p')

the document.getElementsByTagName('p') statement would return all the elements by the tag name p and would store it in the paragraphs variable.