ES6 | Environment Setup
ES6 can run on local machines, only it needs a browser and a text editor. Otherwise, ES6 can run on any host, on any OS. For ES6, it may not be an all-time execute on the browsers. So we need some extra mechanism to executes the ES6 version.
- Code Editor
Code Editor: To write the executable code we will require a text editor. In my opinion, VS code editor is the first choice you can choose. To install VS Code follow the below links.
- First, you have to download and install the Visual Studio. For that, you can refer to Downloading and Installing Visual Studio.
Browser: To run the ES6 program. I prefer to use Google Chrome, there are so many other browsers like Firefox, Internet Explorer, Safari.
Execute the ES6 code:
- Step 1: Now make a folder anywhere of your PC and run command prompt in that folder and make a HTML file by using VS Code editor paste the below code inside the file and save it.
- Step 2: Then write the below command in the command prompt, and hit enter.
npm install http-server -g
- Step 3: Then, after the installation below command will turn on the server.
http-server -p 1234 //1234 is a random port number
- Step 4: After that, open your browser and write below URL in the search box. Then, the HTML page you make earlier after making the folder will show on the web.