Javascript console.assert() Method display object

Introduction

Write an object to the console:

This example demonstrates how an object is displayed when using the console.assert method.

View in separate window

<!DOCTYPE html>
<html>
<body>
<script>
var myObj = { firsname : "CSS", lastname : "HTML" };

console.assert(document.getElementById("demo"), myObj);
</script>//from w  ww. j  av a 2 s  . c  o  m

</body>
</html>



PreviousNext

Related