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
7 questions
Ads_Day16_Facebook Foundation/Pixel
Quiz
•
Professional Development
9 questions
PreTrainingJavaScript
Quiz
•
Professional Development
10 questions
Unity Scripting Beginner (EN)
Quiz
•
12th Grade - Professi...
8 questions
Aula 03 Web design
Quiz
•
Professional Development
10 questions
CLAG 2
Quiz
•
Professional Development
6 questions
Continuous Professional Development(CPD)
Quiz
•
Professional Development
5 questions
🇮🇩 Conditional
Quiz
•
Professional Development
10 questions
Moringa JavaScript Arrays
Quiz
•
5th Grade - Professio...
15 questions
Multiplication Facts
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines
Quiz
•
Professional Development
12 questions
Dividing Fractions
Quiz
•
6th Grade