wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

QUIZZ

Total questions: 60

Worksheet time: 32mins

Name
Class
Date
1.

Which is the correct way to write a JavaScript array?

a)

var txt = new Array(1:"tim",2:"kim",3:"jim")

b)

var txt = new Array:1=("tim")2=("kim")3=("jim")

c)

var txt = new Array("tim","kim","jim")

d)

var txt = new Array="tim","kim","jim"

2.

What is the correct syntax for referring to an external script called " abc.js"?

a)

<script href=" abc.js">

b)

<script name=" abc.js">

c)

<script src=" abc.js">

d)

None of the above

3.

What is the correct JavaScript syntax to write "Hello World"?

a)

System.out.println("Hello World")

b)

println ("Hello World")

c)

document.write("Hello World")

d)

response.write("Hello World")

4.

How does JavaScript store dates in a date object?

a)

The number of milliseconds since January 1st, 1970

b)

The number of days since January 1st, 1900

c)

The number of seconds since Netscape's public stock offering.

d)

None of the above

5.

Which of the following is not a valid JavaScript variable name?

a)

2names

b)

_first_and_last_names

c)

FirstAndLast

d)

None of the above

6.

Which of the following can't be done with client-side JavaScript?

a)

Validating a form

b)

Sending a form's contents by email

c)

Storing the form's contents to a database file on the server

d)

None of the above

7.

How to create a Date object in JavaScript?

a)

dateObjectName = new Date([parameters])

b)

dateObjectName.new Date([parameters])

c)

dateObjectName := new Date([parameters])

d)

dateObjectName Date([parameters])

8.

The _______ method of an Array object adds and/or removes elements from an array.

a)

reverse

b)

shift

c)

slice

d)

splice

9.

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?

a)

push()

b)

join()

c)

pop()

d)

map()

10.

Which of the following function of Array object removes the first element from an array and returns that element?

a)

reverse()

b)

shift()

c)

slice()

d)

some()

11.

Which of the following is not JavaScript Data Types?

a)

Undefined

b)

Number

c)

Boolean

d)

Float

12.

Choose the correct JavaScript syntax to change the content of the following HTML code.

a)

document.getElement (“letsfindcourse").innerHTML = "I am a letsfindcourse";

b)

document.getElementById (“letsfindcourse").innerHTML = "I am a letsfindcourse";

c)

document.getId (“letsfindcourse") = "I am a letsfindcourse";

d)

document.getElementById (“letsfindcourse").innerHTML = I am a letsfindcourse;

13.

Which of the following is the correct syntax to display "Letsfindcourse" in an alert box using JavaScript?

a)

alert-box("Letsfindcourse");

b)

confirm("Letsfindcourse");

c)

msgbox("Letsfindcourse");

d)

alert("Letsfindcourse");

14.

What will be the output of the following Javascript code?

var string1 = "Hello World";

var intvalue = 30;

alert( string1 + intvalue );

a)

Hello World 30

b)

30

c)

Hello World30

d)

Exception

15.

Among the following, which one is a ternary operator in JavaScript?

a)

#

b)

::

c)

&:

d)

?:

16.

Which symbol is used for comments in Javascript?

a)

\\

b)

//

c)

\* *\

d)

\* */

17.

What are the types of Pop up boxes available in JavaScript?

a)

Alert

b)

Prompt

c)

Confirm

d)

All of the above

18.

What are the two basic groups of dataypes in JavaScript?

a)

Primitive

b)

Reference types.

c)

All of the above

d)

None of the above

19.

Among the following given JavaScript snipped codes, which is more efficient:

a)

Code A

for(var number=10;number>=1;number--) { document.writeln(number); }

b)

Code B

var number=10; while(number>=1)

{ document.writeln(number); number++; }

c)

Both Code 1 and Code 2

d)

Cannot Compare

20.

The "function" and " var" are known as:

a)

Keywords

b)

Data types

c)

Declaration statements

d)

Prototypes

21.

Which of the following is the correct output for the following JavaScript code:

a)

10

b)

6

c)

33

d)

0

22.

Which of the following is the correct output for the following JavaScript code:

a)

3

b)

0

c)

Error

d)

2

23.

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?

a)

slice()

b)

split()

c)

substr()

d)

search()

24.

In JavaScript, Window.prompt() method return true or false value ?

a)

True

b)

False

25.

What will be the output of following code?

<script language="javascript">

function x()

{

document.write(2+5+"8");

}

a)

258

b)

Error

c)

78

d)

15

26.

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>

a)

9123456

b)

9123

c)

91234

d)

None of the above

27.

Which is the function that is called to validate a data?

a)

validate()

b)

valid()

c)

validation()

d)

no predefined function for data validation

28.

How to find the index of a particular string?

a)

position()

b)

index()

c)

indexOf()

d)

positionof()

29.

How do you focus a particular part of the HTML page in JavaScript?

a)

hover()

b)

focus()

c)

on()

d)

focuson()

30.

Which is the function used to loop in an array to view all the values?

a)

all()

b)

loop()

c)

each()

d)

none of the mentioned

31.

What is Git?

a)

A programming language

b)

A version control system

c)

A text editor

d)

A database

32.

What does git init do?

a)

Clones a repository

b)

Initializes a new Git repository

c)

Stages changes

d)

Deletes a repository

33.

What is the purpose of git add?

a)

Commit changes to the repository

b)

Add a remote repository

c)

Stage changes for the next commit

d)

Merge branches

34.

Which command is used to create a new branch in Git?

a)

git checkout branch

b)

git branch new_branch

c)

git branch create new_branch

d)

git init new_branch

35.

What does git merge do?

a)

Stages changes for commit

b)

Combines changes from one branch into another

c)

Deletes a branch

d)

Reverts a commit

36.

What is the purpose of git clone?

a)

Create a copy of a repository locally

b)

Stage changes for commit

c)

Merge branches

d)

Update the local branch

37.

What does git pull do?

a)

Fetch and merge changes from a remote repository

b)

Push changes to a remote repository

c)

Merge branches

d)

Delete a branch

38.

Which file is used to ignore certain files from being tracked in Git?

a)

.gitignore

b)

ignore.txt

c)

.ignore

d)

trackless.txt

39.

What does git status show?

a)

A list of remote branches

b)

Current branch and changes

c)

Git configuration

d)

Commit history

40.

Which command is used to view commit history?

a)

git status

b)

git history

c)

git log

d)

git commits

41.

What does git push do?

a)

Uploads local repository content to a remote repository

b)

Downloads content from a remote repository

c)

Creates a new branch

d)

Stages changes for commit

42.

What is a fork in GitHub?

a)

A remote branch

b)

A copy of a repository in your GitHub account

c)

A feature to merge branches

d)

A commit history log

43.

What does a pull request on GitHub do?

a)

Pushes changes to a repository

b)

Merges changes into a branch after review

c)

Clones a repository

d)

Deletes a branch

44.

How do you link a local repository to a remote repository?

a)

git remote add origin

b)

git link origin

c)

git add origin

d)

git remote link

45.

What does git diff display?

a)

Differences between commits

b)

Differences between the staging area and working directory

c)

Differences between branches

d)

All of the above

46.

What is Node.js primarily used for?

a)

Machine learning

b)

Backend development

c)

Frontend development

d)

Mobile app development

47.

Which of these modules is built into Node.js?

a)

lodash

b)

fs

c)

express

d)

react

48.

What is npm?

a)

Node.js Programming Model

b)

Node Package Manager

c)

Network Protocol Manager

d)

None of the above

49.

Which command initializes a new Node.js project?

a)

node start

b)

npm init

c)

node create

d)

npm start

50.

How do you import a module in Node.js?

a)

import 'module'

b)

require('module')

c)

load('module')

d)

include('module')

51.

Which method is used to create a server in Node.js?

a)

http.createServer()

b)

server.create()

c)

node.createServer()

d)

app.createServer()

52.

Which of the following is a non-blocking operation in Node.js?

a)

Synchronous readFile

b)

Asynchronous readFile

c)

Synchronous writeFile

d)

None of the above

53.

How do you handle errors in Node.js?

a)

Using try-catch

b)

Using event listeners

c)

Using callbacks

d)

All of the above

54.

What does process.env represent?

a)

Environmental variables of the Node.js process

b)

A built-in HTTP server

c)

Error handling

d)

A Node.js module loader

55.

Which statement is true about Node.js?

a)

It is single-threaded and non-blocking.

b)

It is multi-threaded and blocking.

c)

It is single-threaded and blocking.

d)

It is multi-threaded and non-blocking.

56.

What is Express.js?

a)

A framework for backend development in Node.js

b)

A database management tool

c)

A frontend library

d)

A version control tool

57.

Which method is used to define a GET route in Express?

a)

app.get()

b)

app.route()

c)

app.post()

d)

app.put()

58.

What does app.listen() do in Express.js?

a)

Handles HTTP requests

b)

Starts the server and listens for incoming connections

c)

Adds a middleware function

d)

Creates a database connection

59.

Which function is used to send a response in Express.js?

a)

res.send()

b)

res.render()

c)

res.write()

d)

Both A and B

60.

What is middleware in Express.js?

a)

A routing function

b)

A function that executes during request processing

c)

A database connection method

d)

None of the above