Javascript console.count() Method count twice

Introduction

Call console.count() two times with and see the result:

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

The first call will write "default: 1", and the second will write "default: 2".

View in separate window

<!DOCTYPE html>
<html>
<body>
<script>

console.count();
console.count();

</script>/*from   w  w  w . jav a  2  s.  co  m*/
<p>This is because both calls have the same label.</p>

</body>
</html>



PreviousNext

Related