← TechnologyThe essentials of

endsWith(): suffix is a text check

Publisher: ResumeMaker • 1 source

Published: 22 Oct 2026 13:13 · Updated: 22 Oct 2026 13:13

AI source check: 21 Oct 2026 12:40. This is not editorial approval.

In a few sentences

In brief

The name ending in .pdf does not prove the file format.

Useful to know

endsWith() checks the end of a string. For example, "report.pdf".endsWith(".pdf") returns true. The check differs uppercase and lowercase : ".PDF" is another sequence . [1]

This is convenient for visually grouping names, but does not authenticate the contents of an uploaded file. A file with random bytes can also be called report.pdf. When uploading, the application must check the actual allowable types and limitations of the server. Do not mix the convenient presentation of the name with proof that the document can be safely processed.

Sources

For further detail and to check the information:

  1. [1] MDN — String.endsWith ↗