Oct 21, 2015

Programming - JavaScript

   Programming is the process of creation of executable computer programs. Doing such requires a certain language, source codes can be written in 1 or more programming languages. Some examples are JavaScript, HTML5, PHP, Python and Ruby. The following is a brief explanation on the JavaScript Basics.

Introduction

   JavaScript is the most popular programming language in the world. It was invented in 1995 by Brendan Eich. The official name is ECMA-262. JavaScript is the programming language of HTML and the Web, it allows us to program the behavior of web pages.

Variables

   JavaScript variables are containers for storing data values. Information must be stored somewhere, that is where variables take place. To create a variable you write 'var name = value;'
Values can be numbers, strings (characters), booleans (true or false), objects (multiple values with an assigned name), strings (multiple values without a name) or simply null or undefined (when there is no information). Variables can later be 'called' to take place in another part of the code by writing it's name. For more information you can click here.

Math

   Just like almost any programming language, JavaScript allows us to do calculations. For doing so it offers us some basic arithmetic operators, like + (addition), - (substraction), * (multiplication), / (division), as well as it allows us to perform other mathematical tasks with certain methods. There is a common misconception from non-programmers: the equal ( = ) does not mean equals to, but instead it is an assignment operator. This means something will take the value after it, just like with variables. For learning more you can click here or here.

Functions

   A JavaScript function is a block of code designed to perform a particular task. A JavaScript function is executed when "something" invokes it (calls it). The syntax to define a function is 'function name(parameter1, parameter2) { code to be executed }'. The benefit of functions is that they can be invoked and used as many times as needed in the program. To invoke a function, you write the function's name followed by a parenthesis, which may include parameters divided by commas. If you wish to know more about functions, click here.

Conclusion

   Although this explanation only explains the basics of JavaScript and they would probably not be understood by somebody new into the programming world, JavaScript is indeed an easy language to learn and is of great use in today's world. If you are interested in learning more about JavaScript, I personally recommend W3Schools, which offers a full explanation on many programming languages. However, there are some other websites, such as SoloLearn, which you can use to learn programming languages and save your progress.




Sources

No comments:

Post a Comment