Reputation: 45
I have been given a code to run to analyse and I cannot find where to run it, I have tried google chrome but it is confusing the hell out of me and my friend told me note plus plus but im not sure how to open that or if that even works thank you for your help
Upvotes: 0
Views: 62
Reputation: 431
You have 2 options to run a js code: Nodejs and any browser you want(I suggest google-chrome)
Option 1(Nodejs):
First you must install nodejs. There are tons of tutorials on the net. Then open cmd/terminal and navigate to the javascript file. Then type node filename.js
.
Option 2(browser):
first create an index.html
file in the directory where the .js file is located. Then open it with any text editor(I suggest brackets
) and enter the following code:
<!DOCTYPE html>
<html>
<head></head>
<body>
<script src="filename.js"></script>
</body>
</html>
Now save the file and close the editor. Click with the right button on the html file and the choose open with->google-chrome. If the js file have console.logs the press f12
while in the browser.
Upvotes: 0
Reputation: 3220
I suppose what you are asking is not how to run it, but how to learn it. Notepad++ is an editor you may use to write your code, then you can view and debug it in approximately any browser. Have a look on how to start learning JavaScript
Upvotes: 0
Reputation: 31
You can run it in the chrome dev tools console, or use something like https://repl.it/languages/javascript or https://jsfiddle.net/
Hope this helps.
Upvotes: 1
Reputation: 471
On chrome press F12 then open the tab console and here you can test your code
Upvotes: 0