‘You\’re Welcome’
“You\’re Welcome”
JavaScript also supports other escape sequences like \t for tab and \n for newline.
Boolean Data Type
The Boolean data type is a binary data type and return either true or false. These operators
are commonly used to indicate results of comparisons. For example,
10 > 5 will give ‘true’ while 5 > 10 will give ‘false’.
Operations on Number data Type
In order to perform calculations, operators are used. JavaScript supports all the basic
operators and the operator precedence is as follows:
Addition and subtraction have the same precedence.
Multiplication and division have the same precedence.
The precedence of multiplication and division is higher than
that of addition and
subtraction.
If an expression contains several operators of the same precedence, then the
expression is evaluated from left to right.
In addition
to the basic operators, JavaScript also supports modulo (%) operator. This
operator performs division and returns the remainder as result. For example, 23%7 is
equal to 2.
Unary Operators
While operators like addition and subtraction
need to operands to execute, some operators
require only one. An example of such operators is
typeof, which
returns the datatype of the
data. For example,
typeof 12 returns ‘number’. Please note that ‘+’ and ‘-‘ can also be used
as unary operators. This is the case when they are used to specify the sign of a number.