<title>JavaScript console.error() Function Tutorial - TutsInsider</title>
box-shadow: inset 0 0 3px 0 #2a73cc;
box-shadow: 0 0 3px 0 #333333;
<h2 class="main-heading">What is JavaScript console.error() Function?</h2>
<div class="main-paragraph">
<p>Press <strong>F12</strong> on your keyboard to open the Browser's console.</p>
<p>Inside 'Console', you will see the output of the Script below.</p>
<p><strong>Note: </strong> Reload the page to re-enter a different number or try a letter to see the results in the console.</p>
let user_age = prompt("Enter Your Age:");
console.error("Your age is : " + user_age );
console.error("Its too early for you to learn JavaScript Programming.");
else if ( user_age > 15 ) {
console.log("Your age is : " + user_age );
console.log("Its pretty easy for you to learn JavaScript Programming.");
console.error("Please enter a valid age.");