Java Script
Java Script
A) Style
B) Interactivity
C) Structure
D) Images
JavaScript?
A) 0
B) “false”
C) Undefined
D) All of the above
==
B) ==
C) =
E) !==
A) // This is a comment
B) /* This is a comment */
C) <!—This is a comment →
D) % This is a comment %
Which function is used to add a new element At the end of an array in JavaScript?
A) Push()
B) Pop()
C) Shift()
D) Unshift()
A) String
B) Object
C) Function
D) Character
Function myFunction() {}
Object in JavaScript?
A) 55
B) 10
C) “10”
D) 15
Hoisting in JavaScript?
A) Let
B) Var
C) Const
D) Hoist
Which method is used to remove the last Element from an array in JavaScript?
A) Slice()
B) Remove()
C) Pop()
D) Delete()
In JavaScript)?
A) parseInt()
B) toInt()
C) convertToInt()
D) strToNum()
A) For loop
B) while loop
C) for…in loop
E) Do…while loop
Function in JavaScript?
What is the correct way to add a comment That spans multiple lines in JavaScript?
A) /* This is a comment */
B) // This is a comment
C) <!—This is a comment →
D) # This is a comment #
Method in JavaScript?
A) +
B) &
C) /
D) –
Return in JavaScript?
A) A random integer
B) A random boolean value
C) A random floating-point number between 0 (inclusive) and 1 (exclusive)
D) A random string
Statement in JavaScript?
{ Console.log(count);
Count++;
C)The values of count variable are logged or stored in a particular location or storage
a) error
b) Sanfoundry_ Javascriptmcq
c) undefined
d) Sanfoundry_Javascriptmcq
a) 10
b) 50
c) 5
d) Error
compare() { int num=2; char b=2; if(a==b) return true; else return false }
a) false
b) true
c) compilation error
d) runtime error
b) Memory leak
c) Error
d) Yes, perfectly
a) Compilation error
b) Runtime error
c) Yes
d) No
function height() { var height = 123.56; var type = (height≥190) ? “tall” : “short”; return type; }
a) short
b) 123.56
c) tall
d) 190
a) -7.25
b) 7.25
c) -7
d) 7
Var a=5 , b=1 var obj = { a : 10 } // with keyword in JavaScript with(obj) { alert(b) }
a) 1
b) 10
c) 5
d) Error
Consider the following JavaScript statement containing regular expressions and check if the pattern
matches.
Var text = “testing: 1, 2, 3”; var pattern = /d+/g;
a) text.check(pattern)
b) pattern.test(text)
c) text==pattern
d) text.equals(pattern)
a) runtime error
b) logical error
c) true
d) false
a) JavaScript .NET
b) JavaScript
c) Cocoa JS
d) jQuery
Which of the following methods/operation does javascript use instead of == and !=?
a) 4
b) 5
c) 0
d) error
a) 1, 2, 3, 6, 7, 8
b) 123
c) 1, 2, 3
d) Error
https://www.w3schools.com/quiztest/quiztest.asp?qtest=JS
By:NADA AYMAN♡.