Javascript console.error() Method display object

Introduction

Use an object as the error message:

Press F12 on your keyboard to view the message in the console view.

View in separate window

<!DOCTYPE html>
<html>
<body>
<script>
var myObj = { firsname : "CSS", lastname : "HTML" };
console.error(myObj);
</script>/*from w w w. jav  a  2 s .c o  m*/

</body>
</html>



PreviousNext

Related