Finally Taking Time To Learn JavaScript (JavaScript)

I first learned about Javascript back in 2003/2004 whilst completing a University course and then briefly touched upon it during my HNC web module in 2016/2017. Since then I’ve been focusing on Python as my primary language, however I’ve decided to expand and refresh/learn more JavaScript.

Like Python, JavaScript can use variables although unlike Python they must be declared as a variable:

var number_of_visitors = 25;

var tells JavaScript that a variable is being created.

number_visitors is the name of the variable.

25 is the value the variable holds.

Like Python, JavaScript uses different data types such as numeric (e.g. numbers such as 3, 0.3 and -3), boolean (e.g. true, false) and string (e.g. text like this).

Like Python, JavaScript can be written in a basic text editor (e.g. textedit or notepad) and then just needs its file extension editing from .txt to .js, although IDEs are available that specialise in JavaScript.

Unlike Python, JavaScript can be called on directly by a web browser. 

Whilst having a quick play I tried getting JavaScript to create a new line on the content it was creating, however as it was putting the content into a webpage I found that the usual \n from Python didn’t work but the <br> from HTML did – so document.write(“<br>”). Getting used to the language changes may take me a little time but I’m hoping to have improved my JavaScript know-how before the end of summer.

 

One thought on “Finally Taking Time To Learn JavaScript (JavaScript)

Comments are closed.