My for loop ran all night and printed 400 pages of 'undefined' to my mom's printer | Coding For Beginners - Freelance Forum - The Community for Independent Professionals
My for loop ran all night and printed 400 pages of 'undefined' to my mom's printer
So last Tuesday I was messing around with JavaScript on my laptop at like 11pm trying to make a simple loop that counts to 10. I forgot to update the counter variable, so it just ran forever without stopping, and somehow the print dialog got triggered. I woke up to 400 pages of the word 'undefined' jamming up my mom's old HP printer in the living room, pages everywhere on the floor. She was not happy. Anyone else ever break something with an infinite loop or is it just me?
A buddy of mine did the same thing with a while loop back in college, except his was spitting out random numbers to a file instead of a printer. Left it running overnight and filled up his whole laptop drive, then the thing froze so bad he had to yank the battery out. His roommate thought the laptop was about to catch fire from how hot it got. The undefined pages are way worse though, at least his mess got cleaned up with a delete key.