NEW
Font size
WorksheetsWeb Development Quiz
Total questions: 30
Worksheet time: 15mins
What does `let` do in JavaScript?
Declares a constant variable
Declares a block-scoped variable
Declares a global variable
Creates a function
Which operator is used for strict equality?
=
==
===
:=
What is the output of `typeof null`?
null
object
undefined
string
What does `parseInt("10.5")` return?
10.5
10
11
NaN
What is the result of `true && false`?
false
true
null
undefined
Which function is used to delay execution?
delay()
setTimeout()
setInterval()
wait()
What is the output of `Boolean(0)`?
0
false
true
null
Which method adds an element to the end of an array?
pushFront()
push()
insert()
append()
What does `map()` do in JavaScript arrays?
Filters elements
Sorts elements
Transforms each element and returns a new array
Modifies the original array
Which symbol starts a comment in JavaScript?
#
//
%%
What does DOM stand for?
Data Object Management
Document Object Model
Dynamic Output Model
Document Output Module
Which method creates a new element in DOM?
newElement()
createElement()
addElement()
makeElement()
Which method adds an element to the DOM?
append()
appendChild()
addChild()
insert()
What is `innerHTML` used for?
Change styles
Set attributes
Get/set HTML content inside an element
Create a new element
Which event is triggered when a button is clicked?
change
hover
click
focus
What does `querySelector("#id")` select?
All elements with a class
All elements with an ID
The first element with that ID
Every element in the document
What is the result of `getElementById("x").value`?
The HTML content
The user input in the field
The CSS style
The element's tag name
Which method removes a node from the DOM?
delete()
remove()
removeChild()
eraseNode()
What does `addEventListener("click", myFunc)` do?
Deletes the event
Prevents default action
Runs `myFunc` when the element is clicked
Adds a hover style
How do you prevent form submission with JavaScript?
stopForm()
event.preventDefault()
clearForm()
return false
Which tag is used to start PHP code?
<php>
<?php
{php}
<?>
Which symbol is used to declare a variable in PHP?
@
$
#
&
How do you output text in PHP?
write()
printLine()
echo
log()
What does `$_POST["email"]` do?
Sends a request
Retrieves submitted form data by name
Saves cookies
Reads the URL
What is the purpose of `htmlspecialchars()`?
Prevents XSS by escaping HTML tags
Connects to databases
Hashes passwords
Parses URLs
Which operator is used to concatenate strings in PHP?
+
.
&
%
What will `count([1,2,3])` return?
2
4
3
true
How do you write a single-line comment in PHP?
# comment
// comment
/** comment */
Which function checks if a form is submitted via POST?
post()
getMethod()
$_SERVER["REQUEST_METHOD"] == "POST"
isPost()
Which file extension is required for PHP files?
.html
.js
.php
.txt
