What will be the output of the following JavaScript code?
<p id="demo"></p>
var txt1 = "St'Joseph's_";
var txt2 = "IT";
document.getElementById("demo").innerHTML = txt1 + txt2;
Quiz on Sample Code - JavaScript
Quiz
•
Professional Development
•
Professional Development
•
Hard
Usha B A
Used 3+ times
FREE Resource
6 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following JavaScript code?
<p id="demo"></p>
var txt1 = "St'Joseph's_";
var txt2 = "IT";
document.getElementById("demo").innerHTML = txt1 + txt2;
error
St'Joseph's_ IT
undefined
St'Joseph's_IT
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following JavaScript code?
<p id="demo">
</p> <script>
var js = 10;
js *= 5;
document.getElementById("demo").innerHTML = js;
</script>
10
50
5
Error
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Will the following JavaScript code work?
var js = (function(x) {return x*x;}(10));
Exception will be thrown
Memory leak
Error
Yes, perfectly
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following JavaScript code snippet?
int a=1;
if(a!=null) // JavaScript not equal to Operators
return 1;
else
return 0;
0
1
Compiler Error
Runtime Error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following JavaScript code?
function height()
{
var height = 123.56;
var type = (height>=190) ? "tall" : "short";
return type;
}
short
123.56
tall
190
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following JavaScript function?
<p id="demo">
</p> <script>
function javascript()
{
// javacript abs() method
document.getElementById("demo").innerHTML = Math.abs(-7.25);
}
</script>
-7.25
7.25
-7
7
10 questions
Data Types and Variables
Quiz
•
Professional Development
10 questions
CPR Quiz_chapter 5_structure
Quiz
•
Professional Development
10 questions
Javascript + JQuery (Parte 1)
Quiz
•
Professional Development
10 questions
Control Flow
Quiz
•
Professional Development
11 questions
DEWE-03_RA 1.1_Tema A
Quiz
•
Professional Development
11 questions
Repaso Gestión de Proyectos Digitales - Clase 1
Quiz
•
Professional Development
7 questions
Ads_Day16_Facebook Foundation/Pixel
Quiz
•
Professional Development
10 questions
Workshop Vue.js Node Stytch
Quiz
•
Professional Development
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade