Friday, 17 January 2014

JavaScript

Now let's start to do the actual programming. In this post and the next posts I am going to talk about a few basic commands used very often in programming languages. The first thing that I want to explain is the 'for' loop. Suppose you want to ask the computer to repeat a procedure 100 times. Suppose there is a function (I will explain about functions more in detail later) or command that sends emails. For example, suppose the command 'print("hello world")' prints the sentence "hello world" on the screen. The the following 'for loop' will print that on screen 100 times: for(var i=0; i<100; i++){ print("hello world"); } Congratulations! You just learned your first lesson in JavaScript. The above code is actually written in a language named "JavaScript". JavaScript is mainly used on web pages. I will later explain more about the language and interesting things you can make with it.

No comments:

Post a Comment