DEV Community

loading...
Cover image for Fun with Javascript!

Fun with Javascript!

Klaus Herberth
Coder. Photographer. Red cross member. Research assistant.
・1 min read

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.

Discussion (0)