How to write java

I want to write javascript but I couldn’t find where can you help me

Codecademy offers some free lessons here: https://www.codecademy.com/learn/introduction-to-javascript

There’s a great free book (you can download as a pdf) here: https://eloquentjavascript.net/

There’s excellent documentation for how javascript works here (you’ll want to bookmark that): https://developer.mozilla.org/en-US/docs/Web/JavaScript

Freecodecamp.org also offers free lessons but I’ve never tried it so I can’t say how good it is: https://www.freecodecamp.org/learn/


As a side note, do note that Java and Javascript are two very different languages. Javascript is tied closer to web-development, whereas java is used for more general programming purposes. They are not interchangeable (though foundational knowledge in one can help understand the other language).

5 Likes

I know everything apart from that java and javascript but what I wanted to say is where i can script because i think is in a file .js but i dont know where I can find this .

ps : escuse me for my bad english because im french :sweat_smile:

2nd ps: Im learning javascript

Salut !

You can write JavaScript with any text editor of your choice. Let me show you a quick example.

To do this, I used SublimeText.

But you could also download Atom or similar.


I created two files.

The first is a simple HTML file, called hello.html

The second is a JavaScript file, called helloworld.js


The HTML file looks like this:

<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>

<h1 id="hi"></h1>

<script src="helloworld.js"></script>
</body>
</html>

What I did is put a simple <h1> tag that will receive data from my JavaScript file.

The second thing is inserting a <script> tag, to link to my JS file.


The JavaScript file looks like this:

let hello = 'Hello';
let world = 'World';

document.getElementById('hi').innerHTML = hello + world;

You can then open your HTML file with your favorite web browser.

The result is this:

So this is one way to write JavaScript locally.


You could also download Node to be able to run JavaScript files from your computer’s terminal.


If you just want to write some JavaScript without the hassle of having to download stuff, you could just write it in an online console, such as https://playcode.io/, or https://jsfiddle.net/, etc.

3 Likes

Ah a fellow sublime user, a user of fine taste :eyeglasses:

1 Like

I’ll just add to the console comment and say that if you make your own practice website file with html and css, if you inspect element while the file is open in the browser you can interactively type js into the console and see what effect it has on the website in real-time. It can be sometimes useful to visualize what’s happening.

1 Like

thank you very much :smiley:

1 Like