The callback of the node listener continues to trigger the listener, why it does not cause an infinite loop

const EventEmitter = require("events");

let emitter = new EventEmitter();

let count = 0;
emitter.on("myEvent", () => {
  console.log("hi" + count);
  countPP;
  emitter.emit("myEvent");
});

emitter.emit("myEvent");

my code output

clipboard.png

I just want to ask why it stopped after 1684 trips. Is it caused by node"s own mechanism or something?

Sep.28,2021

this leads to an infinite loop, which is supposed to burst the stack in the end.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eadfda-47f72.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eadfda-47f72.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?