Difference between javascript and program | Eklavya Online

Difference between javascript and program

Difference between script and program:

1. A program has well defined structure, which must be followed even execute a single file. A script is a set of instructions (may be a single statement), which are complete in it-self. And execute independently as rest of the instructions.

2. Script is loose-type. It means variable’s data-type is not must. In scripting language, variables can be used without declaring them. And its type is defined when values are assigned to them. That is loose-type. Program is strong-type. It means variable’s data-type must be declared. In programming language,
variables cannot be used without declaring them. When data-type of variable is declared, then it accepts only that type of value.

3. Programs are generally compiled, so we need compiler. And scripts are generally interpreted, so we need interpreter. Interpreter is by default available in web-browsers.