How to hide .js and .map files from project explorer in Visual Studio Code

Generally, you would not want to see the compiled .js file and the corresponding files when you are using the Typescript. However you can use tsconfig.json to output the js and map files to a separate folder, it makes it easier to maintain. But if you don’t use a separate folder, you can use settings.json to hide the js and map files in the project folder explorer.

The steps are follows:
1. Open settings.json using File–> Preference –> Settings menu or just press the ctrl + comma. (Click on ‘WORKSPACE SETTINGS’ tab) Or if settings.json is already exist in .vscode folder, just open it.
2. Write the following code:

  "files.exclude": {
    "**/*.js": { "when": "$(basename).ts" },
    "**/*": true