1 Javascript Intro
1 Javascript Intro
COMPUTER PROGRAM
A computer program is a sequence or set of instructions in a programming language for a computer to
execute.
PROGRAMMING LANGUAGE
A programming language is a way for programmers (developers) to communicate with computers.
Programming languages consist of a set of rules that allows string values to be converted into various ways of
generating machine code, or, in the case of visual programming languages, graphical elements.
TEXT EDITOR
A text editor is a type of computer program that edits plain text. Such programs are sometimes known as
"notepad" software.
DATA TYPES
A data type is a classification of data which tells the compiler or interpreter how the programmer intends to
use the data. Most programming languages support various types of data, including integer, real, character or string,
and Boolean.
Data Types Definition Sample Data
Integer Whole Numbers 16, 3, 5
Float Numbers with decimal points 2.1, 13.54
String Mix with characters, numbers and letters John, @password123
Boolean Value must contain only true or false True, False
VARIABLES
Variables are used to store information to be referenced and manipulated in a computer program.
Example;
var x = 3;
var y = 5;
var z = x + y;
Explanation:
• x, y and z are variable names that holds a specific value.
• We use the keyword var to define or declare a variable.
OPERATORS
An operator in a programming language is a symbol that tells the compiler or interpreter to perform specific
mathematical, relational or logical operation and produce final result.
Example:
var base = 3;
var height = 5;
Explanation:
METHOD #1
[2] Open the Text Editor called SubLime. Using a computer
[3] Write the code below and save it your “jsFolder”. Name the file as “hello.js”.
Note: We created the index.html file to link and execute our javascript program in a browser.
[6] Now open the index.html file to execute the hello.js program.
USING ANDROID APP TO WRITE AND EXECUTE JAVASCRIPT PROGRAM
METHOD #2
Using a mobile