typescript get last file extension from name code example Example: javascript find file extension from string var ext = fileName.split('.').pop();