WorksheetsQUIZZ
Total questions: 60
Worksheet time: 32mins
Which is the correct way to write a JavaScript array?
var txt = new Array(1:"tim",2:"kim",3:"jim")
var txt = new Array:1=("tim")2=("kim")3=("jim")
var txt = new Array("tim","kim","jim")
var txt = new Array="tim","kim","jim"
What is the correct syntax for referring to an external script called " abc.js"?
<script href=" abc.js">
<script name=" abc.js">
<script src=" abc.js">
None of the above
What is the correct JavaScript syntax to write "Hello World"?
System.out.println("Hello World")
println ("Hello World")
document.write("Hello World")
response.write("Hello World")
How does JavaScript store dates in a date object?
The number of milliseconds since January 1st, 1970
The number of days since January 1st, 1900
The number of seconds since Netscape's public stock offering.
None of the above
Which of the following is not a valid JavaScript variable name?
2names
_first_and_last_names
FirstAndLast
None of the above
Which of the following can't be done with client-side JavaScript?
Validating a form
Sending a form's contents by email
Storing the form's contents to a database file on the server
None of the above
How to create a Date object in JavaScript?
dateObjectName = new Date([parameters])
dateObjectName.new Date([parameters])
dateObjectName := new Date([parameters])
dateObjectName Date([parameters])
The _______ method of an Array object adds and/or removes elements from an array.
reverse
shift
slice
splice
Which of the following function of Array object creates a new array with the results of calling a provided function on every element in this array?
push()
join()
pop()
map()
Which of the following function of Array object removes the first element from an array and returns that element?
reverse()
shift()
slice()
some()
Which of the following is not JavaScript Data Types?
Undefined
Number
Boolean
Float
Choose the correct JavaScript syntax to change the content of the following HTML code.
document.getElement (“letsfindcourse").innerHTML = "I am a letsfindcourse";
document.getElementById (“letsfindcourse").innerHTML = "I am a letsfindcourse";
document.getId (“letsfindcourse") = "I am a letsfindcourse";
document.getElementById (“letsfindcourse").innerHTML = I am a letsfindcourse;
Which of the following is the correct syntax to display "Letsfindcourse" in an alert box using JavaScript?
alert-box("Letsfindcourse");
confirm("Letsfindcourse");
msgbox("Letsfindcourse");
alert("Letsfindcourse");
What will be the output of the following Javascript code?
var string1 = "Hello World";
var intvalue = 30;
alert( string1 + intvalue );
Hello World 30
30
Hello World30
Exception
Among the following, which one is a ternary operator in JavaScript?
#
::
&:
?:
Which symbol is used for comments in Javascript?
\\
//
\* *\
\* */
What are the types of Pop up boxes available in JavaScript?
Alert
Prompt
Confirm
All of the above
What are the two basic groups of dataypes in JavaScript?
Primitive
Reference types.
All of the above
None of the above
Among the following given JavaScript snipped codes, which is more efficient:
Code A
for(var number=10;number>=1;number--) { document.writeln(number); }
Code B
var number=10; while(number>=1)
{ document.writeln(number); number++; }
Both Code 1 and Code 2
Cannot Compare
The "function" and " var" are known as:
Keywords
Data types
Declaration statements
Prototypes
Which of the following is the correct output for the following JavaScript code:
10
6
33
0
Which of the following is the correct output for the following JavaScript code:
3
0
Error
2
Which of the following function of the String object returns the character in the string starting at the specified position via the specified number of characters?
slice()
split()
substr()
search()
In JavaScript, Window.prompt() method return true or false value ?
True
False
What will be the output of following code?
<script language="javascript">
function x()
{
document.write(2+5+"8");
}
258
Error
78
15
What will be the output of the following code?
<script type="text/javascript">
var s = "9123456";
var pattern = /\d{4}/;
var output = s.match(pattern);
document.write(output);
</script>
9123456
9123
91234
None of the above
Which is the function that is called to validate a data?
validate()
valid()
validation()
no predefined function for data validation
How to find the index of a particular string?
position()
index()
indexOf()
positionof()
How do you focus a particular part of the HTML page in JavaScript?
hover()
focus()
on()
focuson()
Which is the function used to loop in an array to view all the values?
all()
loop()
each()
none of the mentioned
What is Git?
A programming language
A version control system
A text editor
A database
What does git init do?
Clones a repository
Initializes a new Git repository
Stages changes
Deletes a repository
What is the purpose of git add?
Commit changes to the repository
Add a remote repository
Stage changes for the next commit
Merge branches
Which command is used to create a new branch in Git?
git checkout branch
git branch new_branch
git branch create new_branch
git init new_branch
What does git merge do?
Stages changes for commit
Combines changes from one branch into another
Deletes a branch
Reverts a commit
What is the purpose of git clone?
Create a copy of a repository locally
Stage changes for commit
Merge branches
Update the local branch
What does git pull do?
Fetch and merge changes from a remote repository
Push changes to a remote repository
Merge branches
Delete a branch
Which file is used to ignore certain files from being tracked in Git?
.gitignore
ignore.txt
.ignore
trackless.txt
What does git status show?
A list of remote branches
Current branch and changes
Git configuration
Commit history
Which command is used to view commit history?
git status
git history
git log
git commits
What does git push do?
Uploads local repository content to a remote repository
Downloads content from a remote repository
Creates a new branch
Stages changes for commit
What is a fork in GitHub?
A remote branch
A copy of a repository in your GitHub account
A feature to merge branches
A commit history log
What does a pull request on GitHub do?
Pushes changes to a repository
Merges changes into a branch after review
Clones a repository
Deletes a branch
How do you link a local repository to a remote repository?
git remote add origin
git link origin
git add origin
git remote link
What does git diff display?
Differences between commits
Differences between the staging area and working directory
Differences between branches
All of the above
What is Node.js primarily used for?
Machine learning
Backend development
Frontend development
Mobile app development
Which of these modules is built into Node.js?
lodash
fs
express
react
What is npm?
Node.js Programming Model
Node Package Manager
Network Protocol Manager
None of the above
Which command initializes a new Node.js project?
node start
npm init
node create
npm start
How do you import a module in Node.js?
import 'module'
require('module')
load('module')
include('module')
Which method is used to create a server in Node.js?
http.createServer()
server.create()
node.createServer()
app.createServer()
Which of the following is a non-blocking operation in Node.js?
Synchronous readFile
Asynchronous readFile
Synchronous writeFile
None of the above
How do you handle errors in Node.js?
Using try-catch
Using event listeners
Using callbacks
All of the above
What does process.env represent?
Environmental variables of the Node.js process
A built-in HTTP server
Error handling
A Node.js module loader
Which statement is true about Node.js?
It is single-threaded and non-blocking.
It is multi-threaded and blocking.
It is single-threaded and blocking.
It is multi-threaded and non-blocking.
What is Express.js?
A framework for backend development in Node.js
A database management tool
A frontend library
A version control tool
Which method is used to define a GET route in Express?
app.get()
app.route()
app.post()
app.put()
What does app.listen() do in Express.js?
Handles HTTP requests
Starts the server and listens for incoming connections
Adds a middleware function
Creates a database connection
Which function is used to send a response in Express.js?
res.send()
res.render()
res.write()
Both A and B
What is middleware in Express.js?
A routing function
A function that executes during request processing
A database connection method
None of the above
