File type to string javascript code example Example: javascript find file extension from string Click to copyvar ext = fileName.split('.').pop();