Search
Use the endsWith() method to check whether the value of filename ends with ".js".
endsWith()
filename
".js"
For example: