var grade='A';
var result;
switch(grade)
{
case 'A':
result+=10;
case 'B':
result+= 9;
case 'C':
result+= 8;
default:
result+= 0;
}
document.write(result);
10
27
8
0
B. 27
function info()
{
int a=1;
int b=2;
return a*b;
}
document.write(info());
1
2
3
error
Floating numbers
Representation of functions that returns a value
is not present in JavaScript
Form feed
isarrayType()
==
===
typeof
var a = 10;
do {
a += 1;
console.log(a);
} while (a < 5);
11121314
1112
12345
11
function tail(o)
{
for (; o.next; o = o.next) ;
return o;
}
No, this will throw an exception as only numerics can be used in a for loop
No, this will not iterate
Yes, this will work
No, this will result in a runtime error with the message Cannot use Linked List
If the object inherits enumerable properties
The object does not have the properties present in the integer array indices
The delete keyword is never used
Object.defineProperty() is not used
parse
a sync
defer
type
o = {x:1, y:{z:[false,null,]}};
s = JSON.stringify(o);
p = JSON.parse(s);
Object Encapsulation
Object Serialization
Object Abstraction
Object Encoding
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
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
the head tag
the head or body
the title or head
after the body tag
prototype stack
prototype chain
prototype class
prototypes
RMI
Triggering Event
Preprocessor
Function/Method
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
Alternative to if-else
Immediate if
If-then-else statement
Switch statement
The interpreter stops its work
The interpreter throws another exception
The interpreter jumps to the nearest enclosing exception handler
The interpreter throws an error
Int a=1;
if(a>10)
{
document.write(10);
}
else
{
document.write(a);
}
10
0
1
Undefined
High level programming language
Assembly level programming language
Machine level programming language
Low level programming language
var values=[one,two,Three];
var ans=values.shift();
document.writeln(ans);
one
two
three
error
If the object inherits enumerable properties
The object does not have the properties present in the integer array indices
The delete keyword is never used
Object.defineProperty() is not used
void
int
function
main
var book = {
main title: JavaScript,
'sub-title': The Definitive Guide,
for: all audiences,
author: {
firstname: David,
surname: Flanagan
}
};
properties
property values
property names
objects
7.25
-7.25
7
-7
int a==2;
int b=4;
int ans=a+b;
print(ans);
2
6
0
error
+
:
^
?:
Updation, Incrementation, Initialization
Initialization,Testing, Updation
Testing, Updation, Testing
Initialization,Testing, Incrementation
var grade='A';
var result;
switch(grade)
{
case 'A':
result+=10;
case 'B':
result+= 9;
case 'C':
result+= 8;
default:
result+= 0;
}
document.write(result);
10
27
8
0
function height()
{
var height = 123.56;
var type = (height>=190) ? tall : short;
return type;
}
123.56
190
tall
short
Keywords
Declaration statements
Data types
Prototypes
Primary Expression
Object Creation Expression
Invocation Expression
Constructor Calling Expression