Concept Flow - path.extname for file extensions
Input: file path string
Find last '.' in string
If '.' found and not last char
Extract substring from '.' to end
Return file extension
The function takes a file path string, finds the last dot, and returns the substring from that dot to the end as the file extension. If no dot or dot is last, it returns an empty string.