When the function is defined as a looping statement
When the function is defined as expressions
When the function is predefined
when the function is called
B. When the function is defined as expressions
var a=3.7;
var b=2;
a=ciel(a)
document.writeIn(a*b);
6
7.4
7.5
8
debugger
with
if
use strict
RMI
Triggering Event
Preprocessor
Function/Method
var text = testing: 1, 2, 3; // Sample text
var pattern = /d+/g // Matches all instances of one or more digits
text==pattern
text.equals(pattern)
text.test(pattern)
pattern.test(text)
function constfuncs()
{
var funcs = [];
for(var i = 0; i < 10; i++)
funcs[i] = function() { return i; };
return funcs;
}
var funcs = constfuncs();
funcs[5]()
9
0
10
None of the mentioned
int a==2;
int b=4;
int ans=a+b;
print(ans);
2
6
0
error
var values=[1,2,3,4]
var ans=values.slice(1);
document.writeln(ans);
1, 2, 3, 4
2, 3, 4
1, 3, 4
error
An integer
A String
An object
Floating point
var add=new Function(num1,num2,return num1+num2);
document.writeln(add(2,5));
2
5
Error
7
var a = [];
a.unshift(1);
a.unshift(22);
a.shift();
a.unshift(3,[4,5]);
a.shift();
a.shift();
a.shift();
1
[4,5]
[3,4,5]
Exception is thrown
int size=5;
int a=5;
int size=4;
for(int j=size;j>=0;j--)
{
console.log(a);
a=a-2;
}
5555
5321
531-1
531
<script>
txt1 = “ one”;
txt1 += “two”;
document.getElementById("demo").innerHTML = txt1;
</script>
onetwo
one two
error
undefined
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
Updation, Incrementation, Initialization
Initialization,Testing, Updation
Testing, Updation, Testing
Initialization,Testing, Incrementation
function f() {};
Function f
A custom constructor
Prototype of a function
Not valid
switch(expression)
{
statements
}
==
equals
equal
===
filter and fold
inject and fold
finger and fold
fold
<script>
document.getElementById("demo").innerHTML = typeof "John"
</script>
integer
number
string
error
var values=[one,two,Three];
var ans=values.shift();
document.writeln(ans);
one
two
three
error
false.toString()
String(false)
String newvariable=false
Both false.toString() and String(false)
var person =
{
name: Rahul,
getName: function()
{
nreturn this.name;
}
}
var unboundName = person.getName;
var boundName = unboundName.bind(person);
document.writeln(boundName());
runtime error;
compilation error
Rahul
undefined
Create linkage between client side and server side
Permit server side, JavaScript code, to connect to RDBMS
Support only non relational database
To interpret JavaScript code
decrements the total length by 1
increments the total length by 1
prints the first element but no effect on the length
updates the element
for(var num=10;num>=1;num--)
{
document.writeln(num);
}
var num=10;
while(num>=1)
{
document.writeln(num);
num++;
}
Code 1
Code 2
Both Code 1 and Code 2
Cannot Compare
var a=5 , b=1
var obj = { a : 10 }
with(obj)
{
alert(b)
}
10
Error
1
5
const obj = {prop: 12};
Object.preventExtensions(obj);
console.log( Object.isExtensible(obj));
12
false
true
error
var o = new Object();
var o = Object();
var o;
var o= new Object;
Object o=new Object();
function height()
{
var height = 123.56;
var type = (height>=190) ? tall : short;
return type;
}
123.56
190
tall
short
var obj=
{
length:20,
height:35,
}
if (breadth' in obj === false)
{
obj.breadth = 12;
}
console.log(obj.breadth);
20
12
undefined
error