DEV Community

Cover image for Fun with Javascript!
Klaus Herberth
Klaus Herberth

Posted on

Fun with Javascript!

Even after years of experience with Javascript there are new surprises around every corner.

const regex = /foo/g;

if (regex.test('foo bar') && regex.test('foo car'))
  console.log('πŸŽ‰');
else
  console.log('πŸ™ƒ');
Enter fullscreen mode Exit fullscreen mode

What do think is the result? You find the explanation in the MDN documentation.

Top comments (0)

Neon image

Next.js applications: Set up a Neon project in seconds

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Get started β†’

πŸ‘‹ Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay