Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active April 16, 2024 02:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcsee/d1d819ebfaf99b4143e2545fab928adf to your computer and use it in GitHub Desktop.
Save mcsee/d1d819ebfaf99b4143e2545fab928adf to your computer and use it in GitHub Desktop.
const pets = '😺🐶😺';
const justDogs = pets.replaceAll('😺', '🐩');
// Or
const justDogs = pets.replace(/😺/g, '');
const catsArePresent = justDogs.includes('😺');
// returns false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment