JavaScript 2025 · Strings

Check the start, end or contents

Test a string without a regular expression.

url.startsWith("https://");
file.endsWith(".png");
text.includes("error");

Official JavaScript 2025 documentation

More strings commands

All strings commands · JavaScript 2025 cheatsheet

Was this page helpful?