Menu mobile
Home
Programming
Python Tutorial
Java Tutorial
C Tutorial
C++ Tutorial
Web Technology
HTML
CSS
Java Script
PHP
React JS
Node JS
Assignment
MS Office
HTML
CSS
Bootstrap
Java Script
JQuery
AngularJs
Project
Blog
QUIZ ON : javascript - JS BASIC SYNTAX AND DATA TYPES
JS BASIC SYNTAX AND DATA TYPES
00:00:00
English
Hindi
Question No# :
01
out of 25
Which keyword is a must to use when JavaScript code is to run in older browser?
जावास्क्रिप्ट कोड को पुराने ब्राउजर में चलाने के लिए किस कीवर्ड का उपयोग करना आवश्यक है?
A.
var
var
B.
let
let
C.
const
const
D.
none of the above
उपरोक्त में से कोई नहीं
Question No# :
02
out of 25
<p>What type of value gets printed if we add the following two variables ? </p><pre>var a = "10";<br>var b =50;</pre>
<p>यदि हम निम्नलिखित दो चरों को जोड़ते हैं तो किस प्रकार का मूल्य मुद्रित होता है?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;">var a = "10";<br>var b =50;</pre>
A.
Long
Long
B.
Text
Text
C.
Integer
Integer
D.
Number
Number
Question No# :
03
out of 25
What is "this" in JavaScript:
जावास्क्रिप्ट में "this" क्या है:
A.
keyword
keyword
B.
function
function
C.
Declaration Statement
Declaration Statement
D.
Data type
Data type
Question No# :
04
out of 25
Which statement specify correct difference between var and let keywords in JavaScript ?
कौन सा कथन जावास्क्रिप्ट में var और let कीवर्ड के बीच सही अंतर निर्दिष्ट करता है?
A.
var defines a variable while let defines a constant.
var defines a variable while let defines a constant.
B.
There is no such major difference between them.
There is no such major difference between them.
C.
The value of a variable declared with var can be changed while the value of a variable declared with let cannot be changed.
The value of a variable declared with var can be changed while the value of a variable declared with let cannot be changed.
D.
var defined function scoped variable while let define block scoped variable.
var defined function scoped variable while let define block scoped variable.
Question No# :
05
out of 25
<p>Read the following script what is 'function' in this code:</p><pre><span style="font-size: 14px;">function myFunction(){ alert("you have successfully defined the function!");}</span></pre>
<p> निम्नलिखित स्क्रिप्ट पढ़ें, इस कोड में 'फ़ंक्शन' क्या है</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;"><span style="font-size: 14px;">function myFunction(){ alert("you have successfully defined the function!");}</span></pre>
A.
keyword
keyword
B.
Identifier
Identifier
C.
Operator
Operator
D.
None of these
इनमें से कोई नहीं
Question No# :
06
out of 25
What is the output of this expression? x = 2 + "2"; document.write(x);
What is the output of this expression? x = 2 + "2"; document.write(x);
A.
22
22
B.
4
4
C.
2
2
D.
syntax error
syntax error
Question No# :
07
out of 25
How do you write a comment in JavaScript?
जावास्क्रिप्ट में कमेंट कैसे लिखेंगे
A.
//This is a comment
//This is a comment
B.
<!--This is a comment-->
<!--This is a comment-->
C.
/* This is a comment */
/*This is a comment*/
D.
Both A and C
Both A and C
Question No# :
08
out of 25
Which operator is used to assign a value to a variable?
Which operator is used to assign a value to a variable?
A.
=
=
B.
x
x
C.
==
==
D.
*
*
Question No# :
09
out of 25
Which one of the following is not considered as an error
निम्नलिखित में से किसे त्रुटि नहीं माना जाता है
A.
Division by zero
Division by zero
B.
Missing of semicolons
Missing of semicolons
C.
Syntax error
Syntax error
D.
Both A and B
Both A and B
Question No# :
10
out of 25
How do you round the number 7.25, to the nearest integer?
How do you round the number 7.25, to the nearest integer?
A.
round(7.25)
round(7.25)
B.
Math.rnd(7.25)
Math.rnd(7.25)
C.
rnd(7.25)
rnd(7.25)
D.
Math.round(7.25)
Math.round(7.25)
Question No# :
11
out of 25
How do you declare a JavaScript variable?
How do you declare a JavaScript variable?
A.
variable carName;
variable carName;
B.
var carName;
var carName;
C.
vari carName;
vari carName;
D.
dim carName;
dim carName;
Question No# :
12
out of 25
What does the console.log() function do?
console.log() फ़ंक्शन क्या करता है?
A.
Displays a message in an alert box
Displays a message in an alert box
B.
Prints output to the console
Prints output to the console
C.
Writes data to a file
Writes data to a file
D.
Logs an error in the browser console
Logs an error in the browser console
Question No# :
13
out of 25
Which of the following is not a JavaScript datatype?
निम्न में से कौन सा जावास्क्रिप्ट डेटाटाइप नहीं है?
A.
Boolean
Boolean
B.
String
String
C.
Number
Number
D.
Function
Function
Question No# :
14
out of 25
Which statement specify correct difference between var and let keywords in JavaScript?
कौन सा कथन जावास्क्रिप्ट में var और Let कीवर्ड के बीच सही अंतर निर्दिष्ट करता है?
A.
var defines a variable while let defines a constant.
var defines a variable while let defines a constant.
B.
There is no such major difference between them
There is no such major difference between them
C.
The value of variable declared with let cannot be changed
The value of variable declared with let cannot be changed
D.
var define function scoped variable while let define block scoped variable
var define function scoped variable while let define block scoped variable
Question No# :
15
out of 25
What is the correct way to write a JavaScript array?
जावास्क्रिप्ट ऐरे लिखने का सही तरीका क्या है?
A.
var colors = 1 = ("red"), 2 = ("green"), 3 = ("blue")
var colors = 1 = ("red"), 2 = ("green"), 3 = ("blue")
B.
var colors = (1:"red", 2:"green", 3:"blue")
var colors = (1:"red", 2:"green", 3:"blue")
C.
var colors = "red", "green", "blue"
var colors = "red", "green", "blue"
D.
var colors = ["red", "green", "blue"]
var colors = ["red", "green", "blue"]
Question No# :
16
out of 25
How to write an IF statement for executing some code if "i" is NOT equal to 5?
How to write an IF statement for executing some code if "i" is NOT equal to 5?
A.
if (i <> 5)
if (i <> 5)
B.
if (i != 5)
if (i != 5)
C.
if i =! 5 then
if i =! 5 then
D.
if i <> 5
if i <> 5
Question No# :
17
out of 25
What is the correct JavaScript syntax to write "Hello World"?
What is the correct JavaScript syntax to write "Hello World"?
A.
System.out.println("Hello World")
System.out.println("Hello World")
B.
println ("Hello World")
println ("Hello World")
C.
document.write("Hello World")
document.write("Hello World")
D.
response.write("Hello World")
response.write("Hello World")
Question No# :
18
out of 25
Which of the following is not a valid JavaScript variable name?
Which of the following is not a valid JavaScript variable name?
A.
5myvalue
5myvalue
B.
myvalue5
myvalue5
C.
Myvalue
Myvalue
D.
None of These
None of These
Question No# :
19
out of 25
How to write an IF statement in JavaScript?
How to write an IF statement in JavaScript?
A.
if (i == 5)
if (i == 5)
B.
if i == 5 then
if i == 5 then
C.
if i = 5
if i = 5
D.
if i = 5 then
if i = 5 then
Question No# :
20
out of 25
The correct syntax to write "Sky is blue" in JavaScript is
जावास्क्रिप्ट में "Sky is blue" लिखने का सही सिंटैक्स है
A.
jscript.write("Sky is blue")
jscript.write("Sky is blue")
B.
document.write("Sky is blue")
document.write("Sky is blue")
C.
print("Sky is blue")
print("Sky is blue")
D.
jscript.print("Sky is blue")
jscript.print("Sky is blue")
Question No# :
21
out of 25
Which is the correct syntax to call an external JavaScript file in the current HTML document ?
वर्तमान HTML दस्तावेज़ में बाहरी जावास्क्रिप्ट फ़ाइल को कॉल करने के लिए सही सिंटैक्स कौन सा है?
A.
<script src=" test.js"'></script>
<script src=" test.js"'></script>
B.
<script href=" test.js"></script>
<script href=" test.js"></script>
C.
<import src=" test.js"></import>
<import src=" test.js"></import>
D.
<script link=" test.js"></script>
<script link=" test.js"></script>
Question No# :
22
out of 25
What is the purpose of the function keyword in JavaScript?
जावास्क्रिप्ट में function कीवर्ड का उद्देश्य क्या है?
A.
Declares a variable
Declares a variable
B.
Defines a loop
Defines a loop
C.
Creates a function
Creates a function
D.
Represents a conditional statement
Represents a conditional statement
Question No# :
23
out of 25
How can you add a comment in a JavaScript?
How can you add a comment in a JavaScript?
A.
<!--This is a comment-->
<!--This is a comment-->
B.
//This is a comment
//This is a comment
C.
'This is a comment
'This is a comment
D.
#This is a comment
#This is a comment
Question No# :
24
out of 25
How do you write "Hello World" in an alert box ?
आप अलर्ट बॉक्स में ""Hello World" कैसे लिखते हैं?
A.
alert("Hello World")
alert("Hello World")
B.
alertBox("Hello World")
alertBox("Hello World")
C.
msgBox("Hello World")
msgBox("Hello World")
D.
msg("Hello World")
msg("Hello World")
Question No# :
25
out of 25
What is the correct syntax for referring to an external script called "xxx.js" ?
"xxx.js" नामक एक्सटर्नल स्क्रिप्ट को संदर्भित करने के लिए सही स्क्रिप्टक्या है
A.
<script href="xxx.js">
<script href="xxx.js">
B.
<script src="xxx.js">
<script src="xxx.js">
C.
<script name="xxx.js">
<script name="xxx.js">
D.
<script id="xxx.js">
<script id="xxx.js">
CCC Online Test 2021
CCC Practice Test Hindi
Python Programming Tutorials
Best Computer Training Institute in Prayagraj (Allahabad)
Best Java Training Institute in Prayagraj (Allahabad)
Best Python Training Institute in Prayagraj (Allahabad)
O Level Online Test in Hindi
Bank SSC Railway TET UPTET Question Bank
career counselling in allahabad
Sarkari Naukari Notification
Best Website and Software Company in Allahabad
Sarkari Exam Quiz