40. JavaScript label mainly use with break and/or
continue statement.
JavaScript label is unique name as an
identifier for a statement.
General Syntax
label:
or
label:
{
// Scope of the block
}
42. JavaScript array is a collection of values
that are belonging to a same data type.
Notes : JavaScript Array use numeric
indexes where as Object use numeric as
well as string name.
43. my_array = [value1, value2, ..., valueN];
my_array = new Array(value1, value2, ...,
valueN);
my_array = new Array(array_size);
44. Array Literal Method
• var random_list = [5, 12, 8, 22, 2, 30];
• var domain = [".com", ".net", ".org", ".gov"];
JavaScript Built-in Array Constructor Method
var random_list = new Array(5, 12, 8, 22, 2, 30);
var domain = new Array(".com", ".net", ".org", ".gov");
JavaScript size of array length
var domain = new Array(10);
Or
var domain = new Array( );
Find the length of Array Array.length
domain.length
RIGHT CLICK go inspect for error in java script go console
Applicable only number type.
Clear used to clear the warning.
Basically used in if condition
A=prompt(“hello”)
Alert(a)
Default value concept also explain
Scroll resize work on body tag
Key Press(onkeypress) input
Key Up(onkeyup) input
Load(onload) body
Unload(onunload)body
Resize(onresize) body
Scroll(onscroll) div
Arg[a]=prompt(“Enter the value :”);
a.sort()
a.reverse()
a.pop() --- delete last value
a.push(“Ram”) ----- insert in last
a.shift()----- delete first index
a.unshift(“Sita”);-----------insert first place
a.Concat(“”,””);-------atthe end or a.concat(b.c);
c.join(“/”);
a.Slice(start,end)
a.slice(-2)
Splice(index,howmany delete,”new value”)------insert at specified position
a.splice(2,0,”neha”,”karan”);
a.splice(3,2);
Includes used to search the string
Search return position
Match(/is/g) regular expression