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 30
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# :
02
out of 30
When there is an indefinite or an infinity value during an arithmetic value computation in javascript
जब जावास्क्रिप्ट में अंकगणितीय मान गणना के दौरान अनिश्चित या अनंत मान होता है
A.
Prints an exception error
Prints an exception error
B.
Prints an overflow error
Prints an overflow error
C.
Displays “Infinity”
Displays “Infinity”
D.
Prints the value as such
Prints the value as such
Question No# :
03
out of 30
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# :
04
out of 30
Which operator is used to assign a value to a variable in JavaScript?
जावास्क्रिप्ट में किसी वेरिएबल को मान निर्दिष्ट करने के लिए किस ऑपरेटर का उपयोग किया जाता है?
A.
=
=
B.
==
==
C.
===
===
D.
!=
!=
Question No# :
05
out of 30
Which of the following is true about the <script> tag in HTML?
HTML में <script> टैग के बारे में निम्नलिखित में से कौन सा सत्य है?
A.
Multiple <script> tags can be used in the same HTML document
Multiple <script> tags can be used in the same HTML document
B.
The <script> tag can only be placed in the <head> section
The <script> tag can only be placed in the <head> section
C.
The <script> tag can only be used once in an HTML document
The <script> tag can only be used once in an HTML document
D.
The <script> tag must always reference an external file
The <script> tag must always reference an external file
Question No# :
06
out of 30
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# :
07
out of 30
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# :
08
out of 30
Which method is not used for converting variables to number?
वेरिएबल्स को संख्या में बदलने के लिए किस विधि का उपयोग नहीं किया जाता है?
A.
parseInt ()
parseInt ()
B.
Number()
Number()
C.
parseFloat()
parseFloat()
D.
valueOf()
valueOf()
Question No# :
09
out of 30
<p>what will be the output of </p><pre>document.write("5" + 5)</pre>
<pre> document.write("5" + 5)</pre><p>का आउटपुट क्या होगा</p>
A.
5
5
B.
10
10
C.
55
55
D.
error
error
Question No# :
10
out of 30
What is the correct way to embed JavaScript directly within an HTML file?
जावास्क्रिप्ट को सीधे HTML फ़ाइल में एम्बेड करने का सही तरीका क्या है?
A.
<script href="script.js"></script>
<script href="script.js"></script>
B.
<script> alert('Hello, World!'); </script>
<script> alert('Hello, World!'); </script>
C.
<js> alert('Hello, World!'); </js>
<js> alert('Hello, World!'); </js>
D.
<style> alert('Hello, World!'); </style>
<style> alert('Hello, World!'); </style>
Question No# :
11
out of 30
<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# :
12
out of 30
The type of a variable that is volatile is
वेरिएबल का वह प्रकार जो अस्थिर है
A.
Volatile variable
Volatile variable
B.
Mutable variable
Mutable variable
C.
Immutable variable
Immutable variable
D.
Dynamic variable
Dynamic variable
Question No# :
13
out of 30
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# :
14
out of 30
Which of the following is true about the placement of JavaScript in HTML?
HTML में जावास्क्रिप्ट के स्थान के बारे में निम्नलिखित में से कौन सा सत्य है?
A.
JavaScript must always be placed inside the <head> tag
JavaScript must always be placed inside the <head> tag
B.
JavaScript can be placed either in the <head> or <body> tag
JavaScript can be placed either in the <head> or <body> tag
C.
JavaScript can only be placed in external files
JavaScript can only be placed in external files
D.
JavaScript cannot be placed in the <head> tag
JavaScript cannot be placed in the <head> tag
Question No# :
15
out of 30
What is "this" in JavaScript:
जावास्क्रिप्ट में "this" क्या है:
A.
keyword
keyword
B.
function
function
C.
Declaration Statement
Declaration Statement
D.
Data type
Data type
Question No# :
16
out of 30
Which of the following is not a JavaScript datatype?
निम्न में से कौन सा जावास्क्रिप्ट डेटाटाइप नहीं है?
A.
Boolean
Boolean
B.
String
String
C.
Number
Number
D.
Function
Function
Question No# :
17
out of 30
How do you correctly link an external JavaScript file to an HTML document?
आप बाहरी जावास्क्रिप्ट फ़ाइल को HTML दस्तावेज़ से सही ढंग से कैसे लिंक करते हैं?
A.
<script src="script.js"></script>
<script src="script.js"></script>
B.
<javascript src="script.js"></javascript>
<javascript src="script.js"></javascript>
C.
<link href="script.js" rel="script">
<link href="script.js" rel="script">
D.
<script href="script.js"></script>
<script href="script.js"></script>
Question No# :
18
out of 30
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# :
19
out of 30
For testing we should use
परीक्षण के लिए हमें उपयोग करना चाहिए
A.
document. write()
document. write()
B.
console.log()
console.log()
C.
window. alert()
window. alert()
D.
innerHTML
innerHTML
Question No# :
20
out of 30
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# :
21
out of 30
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# :
22
out of 30
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# :
23
out of 30
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# :
24
out of 30
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# :
25
out of 30
For displaying data in JavaScript, we can’t use _
जावास्क्रिप्ट में डेटा प्रदर्शित करने के लिए, हम _ का उपयोग नहीं कर सकते
A.
document. write()
document. write()
B.
console.log()
console.log()
C.
innerHTML
innerHTML
D.
document.getElementById()
document.getElementById()
Question No# :
26
out of 30
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# :
27
out of 30
While working on a JavaScript project, in your JavaScript application, which function would you use to send messages to users requesting for text input?
जावास्क्रिप्ट प्रोजेक्ट पर काम करते समय, आपके जावास्क्रिप्ट एप्लिकेशन में कौन सा कार्य होगा आप टेक्स्ट इनपुट के लिए अनुरोध करने वाले उपयोगकर्ताओं को संदेश भेजने के लिए उपयोग करते हैं?
A.
Display()
Display()
B.
Prompt()
Prompt()
C.
Alert()
Alert()
D.
Confirm()
Confirm()
Question No# :
28
out of 30
JavaScript numbers are stored as
जावास्क्रिप्ट संख्याएँ इस प्रकार संग्रहित की जाती हैं
A.
integers
integers
B.
double precision floating point
double precision floating point
C.
double
double
D.
floating point
floating point
Question No# :
29
out of 30
The snippet that has to be used to check if “a” is not equal to “null” is
The snippet that has to be used to check if “a” is not equal to “null” is
A.
if(a!=null)
if(a!=null)
B.
if (!a)
if (!a)
C.
if(a!null)
if(a!null)
D.
if(a!==null)
if(a!==null)
Question No# :
30
out of 30
Which of the following is/are valid javascript data types?
निम्नलिखित में से कौन जावास्क्रिप्ट डेटा प्रकार नहीं है?
A.
Null type
शून्य प्रकार
B.
Undefined type
अपरिभाषित प्रकार
C.
Number type
संख्या प्रकार
D.
All of the mentioned
उल्लिखित सभी
Latest Current Affairs 2025
Online Exam Quiz for One day Exam
Online Typing Test
CCC Online Test 2025
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