Javascript console.assert() Method display array

Introduction

Write an Array to the console:

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

View in separate window

<!DOCTYPE html>
<html>
<body>
<script>
var myArr = ["Orange", "Banana", "CSS", "HTML" ];

console.assert(document.getElementById("demo"), myArr);
</script>/*from   w  w  w.j ava2  s.  c o  m*/

</body>
</html>



PreviousNext

Related