Created
July 1, 2025 21:27
-
-
Save dumbmoron/1f97bd8f7a02eb8c5428dee72879d637 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function is_extension_of(extension, original) { | |
| if (original.length > extension.length) { | |
| return false; | |
| } | |
| let j = 0; | |
| for (let i = 0; i < extension.length; i++) { | |
| if (extension[i] === original[j]) { | |
| j++; | |
| } | |
| if (j === original.length) { | |
| return true; | |
| } | |
| } | |
| return j === original.length; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment