INTRODUCTION
This language is the popular language in web developments.
javascript is mainly used to decide how web pages will behave.
Syntax
statements are separated using semicolon (;)
example
x= 5;
y=3;
let a =x+y ;
comments doesn't allow execution of unnessary statements. they are shown with (//)
examples
- variables in Javascript variables are containers for storing data or data values. ways to declare variable include;
- using the keyword var
commonly used and it does not have the restrictions that other keywords have.
- using the keyword let used for declaration of block-level variables.
- using the keyword const used for declaration variables whose values are might change
- using nothing
- Data types of Javascript
- String- the data type is mainly used to represent textual data and is created using single or double quotes surrounding one or more characters. example
- Number - used to represent positive or negative numbers with or without decimal place, or numbers written using exponential notation
- Boolean- the data type can hold only two values: true or false. The Boolean values also come as a result of comparisons in a program.
- Object- they are variables which contain more than one value example of a person as shown.
Top comments (0)