<s>
The	O
syntax	O
of	O
JavaScript	B-Language
is	O
the	O
set	O
of	O
rules	O
that	O
define	O
a	O
correctly	O
structured	O
JavaScript	B-Language
program	O
.	O
</s>
<s>
The	O
examples	O
below	O
make	O
use	O
of	O
the	O
log	O
function	O
of	O
the	O
console	O
object	O
present	O
in	O
most	O
browsers	B-Application
for	O
standard	O
text	O
output	O
.	O
</s>
<s>
The	O
JavaScript	B-Language
standard	B-Library
library	I-Library
lacks	O
an	O
official	O
standard	O
text	O
output	O
function	O
(	O
with	O
the	O
exception	O
of	O
document.write	O
)	O
.	O
</s>
<s>
Given	O
that	O
JavaScript	B-Language
is	O
mainly	O
used	O
for	O
client-side	O
scripting	O
within	O
modern	O
web	B-Application
browsers	I-Application
,	O
and	O
that	O
almost	O
all	O
Web	B-Application
browsers	I-Application
provide	O
the	O
alert	O
function	O
,	O
alert	O
can	O
also	O
be	O
used	O
,	O
but	O
is	O
not	O
commonly	O
used	O
.	O
</s>
<s>
Brendan	O
Eich	O
summarized	O
the	O
ancestry	O
of	O
the	O
syntax	O
in	O
the	O
first	O
paragraph	O
of	O
the	O
JavaScript	B-Language
1.1	O
specification	O
as	O
follows	O
:	O
</s>
<s>
JavaScript	B-Language
is	O
case	O
sensitive	O
.	O
</s>
<s>
Unlike	O
in	O
C	B-Language
,	O
whitespace	O
in	O
JavaScript	B-Language
source	O
can	O
directly	O
impact	O
semantics	B-Application
.	O
</s>
<s>
Semicolons	O
end	O
statements	O
in	O
JavaScript	B-Language
.	O
</s>
<s>
Of	O
these	O
,	O
the	O
open	O
parenthesis	O
is	O
common	O
in	O
the	O
immediately	B-Language
invoked	I-Language
function	I-Language
expression	I-Language
pattern	O
,	O
and	O
open	O
bracket	O
occurs	O
sometimes	O
,	O
while	O
others	O
are	O
quite	O
rare	O
.	O
</s>
<s>
Initial	O
semicolons	O
are	O
also	O
sometimes	O
used	O
at	O
the	O
start	O
of	O
JavaScript	B-Language
libraries	O
,	O
in	O
case	O
they	O
are	O
appended	O
to	O
another	O
library	O
that	O
omits	O
a	O
trailing	O
semicolon	O
,	O
as	O
this	O
can	O
result	O
in	O
ambiguity	O
of	O
the	O
initial	O
statement	O
.	O
</s>
<s>
Comment	O
syntax	O
is	O
the	O
same	O
as	O
in	O
C++	B-Language
,	O
Swift	B-Application
and	O
many	O
other	O
languages	O
.	O
</s>
<s>
Variables	O
in	O
standard	O
JavaScript	B-Language
have	O
no	O
type	O
attached	O
,	O
so	O
any	O
value	O
(	O
each	O
value	O
has	O
a	O
type	O
)	O
can	O
be	O
stored	O
in	O
any	O
variable	O
.	O
</s>
<s>
JavaScript	B-Language
is	O
case	O
sensitive	O
,	O
so	O
the	O
uppercase	O
characters	O
"	O
A	O
"	O
through	O
"	O
Z	O
"	O
are	O
different	O
from	O
the	O
lowercase	O
characters	O
"	O
a	O
"	O
through	O
"	O
z	O
"	O
.	O
</s>
<s>
Starting	O
with	O
JavaScript	B-Language
1.5	O
,	O
ISO	O
8859-1	O
or	O
Unicode	O
letters	O
(	O
or	O
\uXXXX	O
Unicode	O
escape	O
sequences	O
)	O
can	O
be	O
used	O
in	O
identifiers	O
.	O
</s>
<s>
In	O
certain	O
JavaScript	B-Language
implementations	O
,	O
the	O
at	O
sign	O
( @	O
)	O
can	O
be	O
used	O
in	O
an	O
identifier	O
,	O
but	O
this	O
is	O
contrary	O
to	O
the	O
specifications	O
and	O
not	O
supported	O
in	O
newer	O
implementations	O
.	O
</s>
<s>
Block	O
scoping	O
can	O
be	O
produced	O
by	O
wrapping	O
the	O
entire	O
block	O
in	O
a	O
function	O
and	O
then	O
executing	O
it	O
–	O
this	O
is	O
known	O
as	O
the	O
immediately-invoked	B-Language
function	I-Language
expression	I-Language
pattern	O
–	O
or	O
by	O
declaring	O
the	O
variable	O
using	O
the	O
let	O
keyword	O
.	O
</s>
<s>
When	O
JavaScript	B-Language
tries	O
to	O
resolve	O
an	O
identifier	O
,	O
it	O
looks	O
in	O
the	O
local	O
scope	O
.	O
</s>
<s>
If	O
it	O
is	O
still	O
not	O
found	O
,	O
JavaScript	B-Language
will	O
raise	O
a	O
ReferenceError	O
exception	O
.	O
</s>
<s>
When	O
assigning	O
an	O
identifier	O
,	O
JavaScript	B-Language
goes	O
through	O
exactly	O
the	O
same	O
process	O
to	O
retrieve	O
this	O
identifier	O
,	O
except	O
that	O
if	O
it	O
is	O
not	O
found	O
in	O
the	O
global	O
scope	O
,	O
it	O
will	O
create	O
the	O
"	O
variable	O
"	O
in	O
the	O
scope	O
where	O
it	O
was	O
created	O
.	O
</s>
<s>
Note	O
that	O
JavaScript	B-Language
's	O
strict	O
mode	O
forbids	O
the	O
assignment	O
of	O
an	O
undeclared	O
variable	O
,	O
which	O
avoids	O
global	O
namespace	O
pollution	O
.	O
</s>
<s>
The	O
JavaScript	B-Language
language	I-Language
provides	O
six	O
primitive	O
data	O
types	O
:	O
</s>
<s>
The	O
value	B-General_Concept
of	I-General_Concept
"	I-General_Concept
undefined	I-General_Concept
"	I-General_Concept
is	O
assigned	O
to	O
all	O
uninitialized	B-Error_Name
variables	I-Error_Name
,	O
and	O
is	O
also	O
returned	O
when	O
checking	O
for	O
object	O
properties	O
that	O
do	O
not	O
exist	O
.	O
</s>
<s>
In	O
a	O
Boolean	O
context	O
,	O
the	O
undefined	B-General_Concept
value	I-General_Concept
is	O
considered	O
a	O
false	O
value	O
.	O
</s>
<s>
Unless	O
explicitly	O
converted	O
,	O
the	O
undefined	B-General_Concept
value	I-General_Concept
may	O
behave	O
unexpectedly	O
in	O
comparison	O
to	O
other	O
types	O
that	O
evaluate	O
to	O
false	O
in	O
a	O
logical	O
context	O
.	O
</s>
<s>
Numbers	O
are	O
represented	O
in	O
binary	O
as	O
IEEE	O
754	O
floating	B-Algorithm
point	I-Algorithm
doubles	O
.	O
</s>
<s>
Although	O
this	O
format	O
provides	O
an	O
accuracy	O
of	O
nearly	O
16	O
significant	B-Architecture
digits	I-Architecture
,	O
it	O
cannot	O
always	O
exactly	O
represent	O
real	O
numbers	O
,	O
including	O
fractions	O
.	O
</s>
<s>
As	O
a	O
result	O
,	O
a	O
routine	O
such	O
as	O
the	O
method	B-Language
should	O
be	O
used	O
to	O
round	B-Algorithm
numbers	O
whenever	O
they	O
are	O
.	O
</s>
<s>
There	O
's	O
also	O
a	O
numeric	B-Algorithm
separator	O
,	O
(	O
the	O
underscore	O
)	O
,	O
introduced	O
in	O
ES2021	O
:	O
</s>
<s>
The	O
extents	O
+∞	O
,	O
−∞	O
and	O
NaN	O
(	O
Not	O
a	O
Number	O
)	O
of	O
the	O
number	O
type	O
may	O
be	O
obtained	O
by	O
two	O
program	O
expressions	O
:	O
</s>
<s>
Infinity	O
and	O
NaN	O
are	O
numbers	O
:	O
</s>
<s>
The	O
Number	O
constructor	O
(	O
used	O
as	O
a	O
function	O
)	O
,	O
or	O
a	O
unary	O
+	O
or	O
-	O
,	O
may	O
be	O
used	O
to	O
perform	O
explicit	O
numeric	B-Algorithm
conversion	O
:	O
</s>
<s>
When	O
used	O
as	O
a	O
constructor	O
,	O
a	O
numeric	B-Algorithm
wrapper	O
object	O
is	O
created	O
(	O
though	O
it	O
is	O
of	O
little	O
use	O
)	O
:	O
</s>
<s>
However	O
,	O
NaN	O
is	O
not	O
equal	O
to	O
itself	O
:	O
</s>
<s>
Especially	O
whole	O
numbers	O
larger	O
than	O
253	O
-	O
1	O
,	O
which	O
is	O
the	O
largest	O
number	O
JavaScript	B-Language
can	O
reliably	O
represent	O
with	O
the	O
Number	O
primitive	O
and	O
represented	O
by	O
the	O
Number.MAX_SAFE_INTEGER	O
constant	O
.	O
</s>
<s>
When	O
dividing	O
BigInts	O
,	O
the	O
results	O
are	O
truncated	B-Algorithm
.	O
</s>
<s>
A	O
string	O
in	O
JavaScript	B-Language
is	O
a	O
sequence	O
of	O
characters	O
.	O
</s>
<s>
In	O
JavaScript	B-Language
,	O
strings	O
can	O
be	O
created	O
directly	O
(	O
as	O
literals	O
)	O
by	O
placing	O
the	O
series	O
of	O
characters	O
between	O
double	O
(	O
"	O
)	O
or	O
single	O
( 	O
 '	O
)	O
quotes	O
.	O
</s>
<s>
The	O
JavaScript	B-Language
standard	O
allows	O
the	O
backquote	O
character	O
( `	O
,	O
a.k.a.	O
</s>
<s>
grave	O
accent	O
or	O
backtick	O
)	O
to	O
quote	O
multiline	O
literal	O
strings	O
,	O
but	O
this	O
is	O
supported	O
only	O
on	O
certain	O
browsers	B-Application
as	O
of	O
2016	O
:	O
Firefox	O
and	O
Chrome	O
,	O
but	O
not	O
Internet	O
Explorer	O
11	O
.	O
</s>
<s>
Individual	O
characters	O
within	O
a	O
string	O
can	O
be	O
accessed	O
using	O
the	O
method	B-Language
(	O
provided	O
by	O
)	O
.	O
</s>
<s>
This	O
is	O
the	O
preferred	O
way	O
when	O
accessing	O
individual	O
characters	O
within	O
a	O
string	O
,	O
because	O
it	O
also	O
works	O
in	O
non-modern	O
browsers	B-Application
:	O
</s>
<s>
In	O
modern	O
browsers	B-Application
,	O
individual	O
characters	O
within	O
a	O
string	O
can	O
be	O
accessed	O
(	O
as	O
strings	O
with	O
only	O
a	O
single	O
character	O
)	O
through	O
the	O
same	O
notation	O
as	O
arrays	B-Data_Structure
:	O
</s>
<s>
However	O
,	O
JavaScript	B-Language
strings	O
are	O
immutable	B-Application
:	O
</s>
<s>
These	O
objects	O
have	O
a	O
method	B-Language
returning	O
the	O
primitive	O
string	O
wrapped	O
within	O
them	O
:	O
</s>
<s>
JavaScript	B-Language
provides	O
a	O
Boolean	O
data	O
type	O
with	O
and	O
literals	O
.	O
</s>
<s>
When	O
type	O
conversion	O
is	O
required	O
,	O
JavaScript	B-Language
converts	O
,	O
,	O
,	O
or	O
operands	O
as	O
follows	O
:	O
</s>
<s>
JavaScript	B-Language
attempts	O
to	O
convert	O
the	O
string	O
numeric	B-Algorithm
literal	O
to	O
a	O
Number	O
type	O
value	O
.	O
</s>
<s>
First	O
,	O
a	O
mathematical	O
value	O
is	O
derived	O
from	O
the	O
string	O
numeric	B-Algorithm
literal	O
.	O
</s>
<s>
If	O
an	O
object	O
is	O
compared	O
with	O
a	O
number	O
or	O
string	O
,	O
JavaScript	B-Language
attempts	O
to	O
return	O
the	O
default	O
value	O
for	O
the	O
object	O
.	O
</s>
<s>
The	O
binary	O
logical	O
operators	O
returned	O
a	O
Boolean	O
value	O
in	O
early	O
versions	O
of	O
JavaScript	B-Language
,	O
but	O
now	O
they	O
return	O
one	O
of	O
the	O
operands	O
instead	O
.	O
</s>
<s>
Automatic	O
type	O
coercion	O
by	O
the	O
comparison	O
operators	O
may	O
differ	O
for	O
cases	O
of	O
mixed	O
Boolean	O
and	O
number-compatible	O
operands	O
(	O
including	O
strings	O
that	O
can	O
be	O
evaluated	O
as	O
a	O
number	O
,	O
or	O
objects	O
that	O
can	O
be	O
evaluated	O
as	O
such	O
a	O
string	O
)	O
,	O
because	O
the	O
Boolean	O
operand	O
will	O
be	O
compared	O
as	O
a	O
numeric	B-Algorithm
value	O
.	O
</s>
<s>
An	O
expression	O
can	O
be	O
explicitly	O
cast	O
to	O
a	O
Boolean	O
primitive	O
by	O
doubling	O
the	O
logical	O
negation	O
operator	O
:	O
(	O
)	O
,	O
using	O
the	O
function	O
,	O
or	O
using	O
the	O
conditional	B-Language
operator	I-Language
:	O
(	O
c	B-Language
?	O
</s>
<s>
Because	O
all	O
objects	O
evaluate	O
as	O
,	O
a	O
method	B-Language
such	O
as	O
,	O
or	O
,	O
must	O
be	O
used	O
to	O
retrieve	O
the	O
wrapped	O
value	O
.	O
</s>
<s>
A	O
Symbol	O
is	O
a	O
unique	O
and	O
immutable	B-Application
identifier	O
.	O
</s>
<s>
The	O
JavaScript	B-Language
language	I-Language
provides	O
a	O
handful	O
of	O
native	O
objects	O
.	O
</s>
<s>
JavaScript	B-Language
native	O
objects	O
are	O
considered	O
part	O
of	O
the	O
JavaScript	B-Language
specification	O
.	O
</s>
<s>
JavaScript	B-Language
environment	O
notwithstanding	O
,	O
this	O
set	O
of	O
objects	O
should	O
always	O
be	O
available	O
.	O
</s>
<s>
An	O
Array	O
is	O
a	O
JavaScript	B-Language
object	O
prototyped	O
from	O
the	O
Array	O
constructor	O
specifically	O
designed	O
to	O
store	O
data	O
values	O
indexed	O
by	O
integer	O
keys	O
.	O
</s>
<s>
Arrays	B-Data_Structure
,	O
unlike	O
the	O
basic	O
Object	O
type	O
,	O
are	O
prototyped	O
with	O
methods	O
and	O
properties	O
to	O
aid	O
the	O
programmer	O
in	O
routine	O
tasks	O
(	O
for	O
example	O
,	O
join	O
,	O
slice	O
,	O
and	O
push	O
)	O
.	O
</s>
<s>
As	O
in	O
the	O
C	B-Language
family	O
,	O
arrays	B-Data_Structure
use	O
a	O
zero-based	O
indexing	O
scheme	O
:	O
A	O
value	O
that	O
is	O
inserted	O
into	O
an	O
empty	O
array	O
by	O
means	O
of	O
the	O
push	O
method	B-Language
occupies	O
the	O
0th	O
index	O
of	O
the	O
array	O
.	O
</s>
<s>
Arrays	B-Data_Structure
have	O
a	O
length	O
property	O
that	O
is	O
guaranteed	O
to	O
always	O
be	O
larger	O
than	O
the	O
largest	O
integer	O
index	O
used	O
in	O
the	O
array	O
.	O
</s>
<s>
Elements	O
of	O
Arrays	B-Data_Structure
may	O
be	O
accessed	O
using	O
normal	O
object	O
property	O
access	O
notation	O
:	O
</s>
<s>
Arrays	B-Data_Structure
are	O
implemented	O
so	O
that	O
only	O
the	O
defined	O
elements	O
use	O
memory	O
;	O
they	O
are	O
"	O
sparse	B-Algorithm
arrays	I-Algorithm
"	O
.	O
</s>
<s>
One	O
can	O
use	O
the	O
object	O
declaration	O
literal	O
to	O
create	O
objects	O
that	O
behave	O
much	O
like	O
associative	B-Application
arrays	I-Application
in	O
other	O
languages	O
:	O
</s>
<s>
One	O
can	O
use	O
the	O
object	O
and	O
array	O
declaration	O
literals	O
to	O
quickly	O
create	O
arrays	B-Data_Structure
that	O
are	O
associative	O
,	O
multidimensional	O
,	O
or	O
both	O
.	O
</s>
<s>
(	O
Technically	O
,	O
JavaScript	B-Language
does	O
not	O
support	O
multidimensional	O
arrays	B-Data_Structure
,	O
but	O
one	O
can	O
mimic	O
them	O
with	O
arrays-of-arrays	O
.	O
)	O
</s>
<s>
Methods	O
to	O
extract	O
fields	O
are	O
provided	O
,	O
as	O
well	O
as	O
a	O
useful	O
toString	B-Language
:	O
</s>
<s>
These	O
can	O
be	O
caught	O
by	O
try	O
...	O
catch	O
finally	O
...	O
blocks	O
as	O
described	O
in	O
the	O
section	O
on	O
exception	B-General_Concept
handling	I-General_Concept
.	O
</s>
<s>
+	O
Methods	O
of	O
the	O
Math	O
objectExampleReturned	O
valuerounded	O
to	O
5	O
digitsDescription	O
2.3	O
Absolute	O
value	O
=	O
45°	O
Arccosine	O
=	O
45°	O
Arcsine	O
=	O
45°	O
Half	O
circle	O
arctangent	O
(	O
to	O
)	O
=	O
Whole	O
circle	O
arctangent	O
(	O
to	O
)	O
2	O
Ceiling	O
:	O
round	B-Algorithm
up	O
to	O
smallest	O
integer	O
≥	O
argument	O
0.70711	O
Cosine	O
(	O
1	O
)	O
2.7183	O
Exponential	O
function	O
:	O
raised	O
to	O
this	O
power	O
1	O
Floor	O
:	O
round	B-Algorithm
down	O
to	O
largest	O
integer	O
≤	O
argument	O
1	O
Natural	O
logarithm	O
,	O
base	O
1	O
Maximum	O
:	O
Minimum	O
:	O
9	O
Exponentiation	O
(	O
raised	O
to	O
the	O
power	O
of	O
)	O
:	O
gives	O
xy	O
e.g.	O
</s>
<s>
0.17068	O
Pseudorandom	B-Error_Name
number	I-Error_Name
between	O
0	O
(	O
inclusive	O
)	O
and	O
1	O
(	O
exclusive	O
)	O
2	O
Round	B-Algorithm
to	O
the	O
nearest	B-Algorithm
integer	I-Algorithm
;	O
half	O
fractions	O
are	O
rounded	O
up	O
(	O
e.g.	O
</s>
<s>
Every	O
function	O
in	O
JavaScript	B-Language
is	O
an	O
instance	O
of	O
the	O
Function	O
constructor	O
:	O
</s>
<s>
As	O
a	O
unary	O
operator	O
,	O
it	O
can	O
convert	O
a	O
numeric	B-Algorithm
string	O
to	O
a	O
number	O
.	O
</s>
<s>
JavaScript	B-Language
supports	O
the	O
following	O
binary	O
arithmetic	O
operators	O
:	O
</s>
<s>
JavaScript	B-Language
supports	O
the	O
following	O
unary	O
arithmetic	O
operators	O
:	O
</s>
<s>
In	O
Mozilla	O
's	O
JavaScript	B-Language
,	O
since	O
version	O
1.7	O
,	O
destructuring	O
assignment	O
allows	O
the	O
assignment	O
of	O
parts	O
of	O
data	O
structures	O
to	O
several	O
variables	O
at	O
once	O
.	O
</s>
<s>
Spread	O
syntax	O
provides	O
another	O
way	O
to	O
destructure	O
arrays	B-Data_Structure
.	O
</s>
<s>
Rest	O
parameters	O
are	O
similar	O
to	O
Javascript	B-Language
's	O
arguments	O
object	O
,	O
which	O
is	O
an	O
array-like	O
object	O
that	O
contains	O
all	O
of	O
the	O
parameters	O
(	O
named	O
and	O
unnamed	O
)	O
in	O
the	O
current	O
function	O
call	O
.	O
</s>
<s>
JavaScript	B-Language
provides	O
four	O
logical	O
operators	O
:	O
</s>
<s>
ternary	O
conditional	B-Language
(	O
c	B-Language
?	O
</s>
<s>
Numbers	O
:	O
0	O
,	O
-0	O
,	O
NaN	O
,	O
</s>
<s>
JavaScript	B-Language
provides	O
short-circuit	O
evaluation	O
of	O
expressions	O
;	O
the	O
right	O
operand	O
is	O
only	O
executed	O
if	O
the	O
left	O
operand	O
does	O
not	O
suffice	O
to	O
determine	O
the	O
value	O
of	O
the	O
expression	O
.	O
</s>
<s>
In	O
early	O
versions	O
of	O
JavaScript	B-Language
and	O
JScript	B-Language
,	O
the	O
binary	O
logical	O
operators	O
returned	O
a	O
Boolean	O
value	O
(	O
like	O
most	O
C-derived	O
programming	O
languages	O
)	O
.	O
</s>
<s>
Programmers	O
who	O
are	O
more	O
familiar	O
with	O
the	O
behavior	O
in	O
C	B-Language
might	O
find	O
this	O
feature	O
surprising	O
,	O
but	O
it	O
allows	O
for	O
a	O
more	O
concise	O
expression	O
of	O
patterns	O
like	O
null	O
coalescing	O
:	O
</s>
<s>
JavaScript	B-Language
supports	O
the	O
following	O
binary	O
bitwise	O
operators	O
:	O
</s>
<s>
JavaScript	B-Language
supports	O
the	O
following	O
unary	O
bitwise	O
operator	O
:	O
</s>
<s>
JavaScript	B-Language
supports	O
the	O
following	O
binary	O
assignment	O
operators	O
:	O
</s>
<s>
The	O
conditional	B-Language
operator	I-Language
creates	O
an	O
expression	O
that	O
evaluates	O
as	O
one	O
of	O
two	O
expressions	O
depending	O
on	O
a	O
condition	O
.	O
</s>
<s>
I.e.	O
,	O
the	O
conditional	B-Language
operator	I-Language
is	O
to	O
expressions	O
what	O
if	O
is	O
to	O
statements	O
.	O
</s>
<s>
Unlike	O
the	O
if	O
statement	O
,	O
the	O
conditional	B-Language
operator	I-Language
cannot	O
omit	O
its	O
"	O
else-branch	O
"	O
.	O
</s>
<s>
The	O
syntax	O
of	O
the	O
JavaScript	B-Language
switch	O
statement	O
is	O
as	O
follows	O
:	O
</s>
<s>
The	O
syntax	O
of	O
the	O
JavaScript	B-Language
for	B-Language
loop	I-Language
is	O
as	O
follows	O
:	O
</s>
<s>
The	O
syntax	O
of	O
the	O
JavaScript	B-Language
for	O
...	O
in	O
loop	O
is	O
as	O
follows	O
:	O
</s>
<s>
Thus	O
it	O
may	O
be	O
better	O
to	O
use	O
a	O
traditional	O
for	B-Language
loop	I-Language
with	O
a	O
numeric	B-Algorithm
index	O
when	O
iterating	O
over	O
arrays	B-Data_Structure
.	O
</s>
<s>
There	O
are	O
differences	O
between	O
the	O
various	O
Web	B-Application
browsers	I-Application
with	O
regard	O
to	O
which	O
properties	O
will	O
be	O
reflected	O
with	O
the	O
for	O
...	O
in	O
loop	O
statement	O
.	O
</s>
<s>
In	O
theory	O
,	O
this	O
is	O
controlled	O
by	O
an	O
internal	O
state	O
property	O
defined	O
by	O
the	O
ECMAscript	O
standard	O
called	O
"	O
DontEnum	O
"	O
,	O
but	O
in	O
practice	O
,	O
each	O
browser	B-Application
returns	O
a	O
slightly	O
different	O
set	O
of	O
properties	O
during	O
introspection	O
.	O
</s>
<s>
Thus	O
,	O
adding	O
a	O
method	B-Language
to	O
the	O
array	O
prototype	O
with	O
}	O
may	O
cause	O
for	O
...	O
in	O
loops	O
to	O
loop	O
over	O
the	O
method	B-Language
's	O
name	O
.	O
</s>
<s>
The	O
syntax	O
of	O
the	O
JavaScript	B-Language
while	O
loop	O
is	O
as	O
follows	O
:	O
</s>
<s>
The	O
syntax	O
of	O
the	O
JavaScript	B-Language
do	O
...	O
while	O
loop	O
is	O
as	O
follows	O
:	O
</s>
<s>
The	O
semantics	B-Application
are	O
similar	O
to	O
the	O
with	O
statement	O
of	O
Pascal	B-Application
.	O
</s>
<s>
JavaScript	B-Language
supports	O
nested	O
labels	O
in	O
most	O
implementations	O
.	O
</s>
<s>
Although	O
goto	B-Application
is	O
a	O
reserved	O
word	O
,	O
goto	B-Application
is	O
not	O
implemented	O
in	O
JavaScript	B-Language
.	O
</s>
<s>
Furthermore	O
,	O
they	O
implement	O
full	O
closures	B-Language
by	O
remembering	O
the	O
outer	O
function	O
's	O
local	O
variables	O
even	O
after	O
the	O
outer	O
function	O
has	O
exited	O
.	O
</s>
<s>
Objects	O
are	O
entities	O
that	O
have	O
an	O
identity	O
(	O
they	O
are	O
only	O
equal	O
to	O
themselves	O
)	O
and	O
that	O
map	O
property	O
names	O
to	O
values	O
(	O
"	O
slots	O
"	O
in	O
prototype-based	B-Application
programming	I-Application
terminology	O
)	O
.	O
</s>
<s>
Objects	O
may	O
be	O
thought	O
of	O
as	O
associative	B-Application
arrays	I-Application
or	O
hashes	O
,	O
and	O
are	O
often	O
implemented	O
using	O
these	O
data	O
structures	O
.	O
</s>
<s>
However	O
,	O
objects	O
have	O
additional	O
features	O
,	O
such	O
as	O
a	O
prototype	O
chain	O
,	O
which	O
ordinary	O
associative	B-Application
arrays	I-Application
do	O
not	O
have	O
.	O
</s>
<s>
JavaScript	B-Language
has	O
several	O
kinds	O
of	O
built-in	O
objects	O
,	O
namely	O
Array	O
,	O
Boolean	O
,	O
Date	O
,	O
Function	O
,	O
Math	O
,	O
Number	O
,	O
Object	O
,	O
RegExp	O
and	O
String	O
.	O
</s>
<s>
For	O
example	O
,	O
in	O
a	O
browser	B-Application
,	O
typical	O
host	O
objects	O
belong	O
to	O
the	O
DOM	O
(	O
window	O
,	O
form	O
,	O
links	O
,	O
etc	O
.	O
</s>
<s>
This	O
is	O
the	O
basis	O
for	O
JSON	B-General_Concept
,	O
which	O
is	O
a	O
simple	O
notation	O
that	O
uses	O
JavaScript-like	O
syntax	O
for	O
data	O
exchange	O
.	O
</s>
<s>
A	O
method	B-Language
is	O
simply	O
a	O
function	O
that	O
has	O
been	O
assigned	O
to	O
a	O
property	O
name	O
of	O
an	O
object	O
.	O
</s>
<s>
Unlike	O
many	O
object-oriented	O
languages	O
,	O
there	O
is	O
no	O
distinction	O
between	O
a	O
function	O
definition	O
and	O
a	O
method	B-Language
definition	O
in	O
object-related	O
JavaScript	B-Language
.	O
</s>
<s>
Rather	O
,	O
the	O
distinction	O
occurs	O
during	O
function	O
calling	O
;	O
a	O
function	O
can	O
be	O
called	O
as	O
a	O
method	B-Language
.	O
</s>
<s>
When	O
called	O
as	O
a	O
method	B-Language
,	O
the	O
standard	O
local	O
variable	O
is	O
just	O
automatically	O
set	O
to	O
the	O
object	O
instance	O
to	O
the	O
left	O
of	O
the	O
""	O
.	O
</s>
<s>
(	O
There	O
are	O
also	O
and	O
methods	O
that	O
can	O
set	O
explicitly	O
—	O
some	O
packages	O
such	O
as	O
jQuery	B-Language
do	O
unusual	O
things	O
with	O
.	O
)	O
</s>
<s>
Functions	O
are	O
objects	O
themselves	O
,	O
which	O
can	O
be	O
used	O
to	O
produce	O
an	O
effect	O
similar	O
to	O
"	O
static	O
properties	O
"	O
(	O
using	O
C++	B-Language
/Java	O
terminology	O
)	O
as	O
shown	O
below	O
.	O
</s>
<s>
Object	O
deletion	O
is	O
rarely	O
used	O
as	O
the	O
scripting	O
engine	O
will	O
garbage	B-General_Concept
collect	I-General_Concept
objects	O
that	O
are	O
no	O
longer	O
being	O
referenced	O
.	O
</s>
<s>
JavaScript	B-Language
supports	O
inheritance	O
hierarchies	O
through	O
prototyping	O
in	O
the	O
manner	O
of	O
Self	B-Operating_System
.	O
</s>
<s>
JavaScript	B-Language
includes	O
a	O
try	O
...	O
catch	O
...	O
finally	O
exception	B-General_Concept
handling	I-General_Concept
statement	O
to	O
handle	O
run-time	O
errors	O
.	O
</s>
<s>
The	O
try	O
...	O
catch	O
...	O
finally	O
statement	O
catches	O
exceptions	B-General_Concept
resulting	O
from	O
an	O
error	O
or	O
a	O
throw	O
statement	O
.	O
</s>
<s>
Initially	O
,	O
the	O
statements	O
within	O
the	O
try	B-General_Concept
block	I-General_Concept
execute	O
.	O
</s>
<s>
This	O
can	O
be	O
used	O
to	O
free	O
resources	O
,	O
although	O
memory	O
is	O
automatically	O
garbage	B-General_Concept
collected	I-General_Concept
.	O
</s>
<s>
They	O
follow	O
a	O
syntax	O
similar	O
to	O
that	O
used	O
in	O
Java	B-Language
:	O
</s>
<s>
In	O
a	O
browser	B-Application
,	O
the	O
event	O
is	O
more	O
commonly	O
used	O
to	O
trap	O
exceptions	B-General_Concept
.	O
</s>
