Episode #3 | JavaScript


Sunday, 09 Sep 2018 Kudzai Nyandoro 8:51 Minutes

Description:

JavaScript(JS) is a programming language used in the web browser to add life and interactivity to web pages.

Notes:

It is important to know the basics of HTML and CSS before learning JavaScript. If you would like to learn more about HTML click on this link to visit the HTML tutorial if you would like to learn more about CSS, click on this link for the CSS tutorial. This is just a brief introduction to JavaScript. For more in-depth tutorials, see the links provided below, and search the web for alternatives, it's worth it if you ask me.

There are many books and tutorials on JavaScript, the purpose of this tutorial is to share some of the resources that I have tried and found helpful and to introduce anyone new to web development. To get started with JavaScript, open up any web browser of your choice, this could be Firefox, Chrome, or any web browser that you prefer to use, I'm using Chrome. Right-click and select Inspect. Next click on the Console and we can start writing some JavaScript code from here.

Addition
>  40 + 7
Multiplication
> 4 * 7
Division
> 4/7
Subtraction
> 4 - 7
Variables and the Prompt Method
> var name = prompt("What is your name?");
> var city = prompt("Where do you live?");
> var hobby = prompt("What is your favorite hobby?");
Using the Alert Method
> alert(`My name is ${name}, I live in ${city} and my favorite hobby is ${hobby}.`);

There is so much more to learn about JavaScript, below are some of the resources available on the web.


Sources

Mozilla Developer Network, JavaScript Tutorial | Learn Enough Society, JavaScript Tutorial | You Don't Know JavaSCript, JavaScript Tutorial