A short article on JavaScript tricks and technique.
Without it, computers wonβt work. Who can learn how to program? Even young children, using a special programming language called Logo, are able to write programs. As an introduction to programming and programming languages, we will spend a few weeks learning about JavaScript, a programming language designed to work with Web pages.
A program is a set or sequence of instructions entered into a computer to perform work. Programs are written in programming languages, such as Visual Basic, Java, C++, or JavaScript. The term script is sometimes used to denote a JavaScript program. Programming languages are made up of special terms (called keywords), commands, and ways to represent information (data). Programs at first may seem a little strange, but they basically contain English words.
However, the computer cannot carry out instructions written in English. It only understands instructions written in its very own language, machine code, or binary code. Binary code consists of patterns made up of nothing but 1s and 0s. Can you imagine writing instructions for a computer using just 0s and 1s? Actually, the first programmers had to do this. But then computer scientists figured out a better way. They devised a mechanism to allow programmers to write instructions similar to human language, and then used the computer itself to translate those instructions into machine code.
How does a program get translated into binary code? Well, another program does the job! There are two techniques used to translate a program into binary code. One is called a compiler. A compiler looks at all the instructions in the program, and then translates the entire list into a full set of binary instructions. The second type is called an interpreter. An interpreter looks at only one instruction at a time, and then translates it into binary code, and the computer executes those instructions. The language we will study, JavaScript, is an interpreted language. When you execute a JavaScript program, your Web browser, i.e. Netscape or Internet Explorer, does the job of interpreting your JavaScript code.