Before each iteration, the interpreter evaluates the variable expression and assigns the name of the property
The iterations can be infinite when an interpreter is used
The body of the loop is executed only once
the iteration is finite when an interpreter is used
A. Before each iteration, the interpreter evaluates the variable expression and assigns the name of the property
Procedures
Method
Static function
Dynamic function
if(a!=null)
if (!a)
if(a!null)
if(a!==null)
The property will be stored in a cache
The loop will not run
That property will not be enumerated
The property will be enumerated
Int a=1;
if(a>10)
{
document.write(10);
}
else
{
document.write(a);
}
10
0
1
Undefined
filter and fold
inject and fold
finger and fold
fold
debugger
with
if
use strict
int a==2;
int b=4;
int ans=a+b;
print(ans);
2
6
0
error
<script>
var x = 5;
var y = 2;
var z = x % y;
document.getElementById("demo").innerHTML = z;
</script>
0
1
2
5
function f(o)
{
if (o === undefined) debugger;
}
It does nothing but a simple breakpoint
It debugs the error in that statement and restarts the statements execution
It is used as a keyword that debugs the entire program at once
It is used to find error in the statement
var count = [1,,3];
The omitted value takes undefined
This results in an error
This results in an exception
The omitted value takes an integer value
while (a != 0)
{
if (a == 1)
continue;
else
a++;
}
The continue keyword restarts the loop
The continue keyword skips the next iteration
The continue keyword skips the rest of the statements in that iteration
The continue keyword breaks out of the loop
string a = hi;
string b =there;
alert(a+b);
hi
there
hithere
undefined
prototype stack
prototype chain
prototype class
prototypes
stand-alone expressions
basic expressions containing all necessary functions
contains variable references alone
contains only keywords
parse
a sync
defer
type
The property will be stored in a cache
The loop will not run
That property will not be enumerated
The property will be enumerated
make computations in HTML simpler
minimize storage requirements on the web server
increase the download time for the client
increase the loading time of the website
function printArray(a)
{
var len = a.length, i = 0;
if (len == 0)
console.log(Empty Array);
else
{
do
{
console.log(a[i]);
} while (++i < len);
}
}
Prints the numbers in the array in order
Prints the numbers in the array in the reverse order
Prints 0 to the length of the array
Prints Empty Array
make all of the own properties of that object non configurable
to configure and bring a writable property
lock down objects into a known state and prevent outside tampering
to include new properties into the object
var pow=new Function(num1,num2,return Math.pow(num1,num2));
document.writeln(pow(2,3));
2
3
8
error
Returns the value and continues executing rest of the statements, if any
Returns the value and stops the program
Returns the value and stops executing the function
Stops executing the function and returns the value
Reverses and stores in the same array
Reverses and concatenates the elements of the array
Reverses
Stores the elements of an array in normal order
debugger
with
if
use strict
function code(id,name)
{
this.id = id;
this.name = name;
}
function pcode(id,name)
{
code.call(this,id,name);
}
document.writeln(new pcode(101,vivek).id);
vivek
101
Runtime error
Compilation error
conditional block
block that contains a single statement
both conditional block and a single statement
block that combines multiple statements into a single compound statement
function output(option)
{
return (option ? yes : no);
}
bool ans=true;
console.log(output(ans));
Yes
No
Runtime error
Compilation error
function compare()
{
int num=2;
char b=2;
if(a==b)
return true;
else
return false;
}
true
false
runtime error
compilation error
var grade='B';
var result;
switch(grade)
{
case 'A':
{
result+=10;
break;
}
case 'B':
{
result+= 9;
break;
}
case 'C':
{
result+= 8;
break;
}
default:
result+= 0;
}
document.write(result);
10
9
8
0
Keywords
Declaration statements
Data types
Prototypes
RMI
Triggering Event
Preprocessor
Function/Method