get file extension in react js code example Example: javascript find file extension from string var ext = fileName.split('.').pop();