My FeedDiscussionsHeadless CMS
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Can you write a shortest infinite loop?

Girish Patil's photo
Girish Patil
·Dec 10, 2018

I know this might sound silly. But, what's the shortest infinite loop you can write?


  1. Use anything from assembly -> shell scripts -> java -> js -> brainfuck
  2. Print 1 in a newline
  3. Remove all possible spaces, making as many less chars as possible

Update your answer as you think of new one

Edit : Current shortest infinite loop @CodingCreature in fish lang with 4 chars. You can try it out here