Font size
WorksheetsJavaScript Lesson 1
Total questions: 20
Worksheet time: 15mins
JavaScript is standardized under which name?
TypeScript
MACEScript
ECMAScript
JScript
Who created JavaScript?
Bill Gates
Brendan Eich
Elon Musk
Brandon Aich
What is JavaScript mainly used for in creating a web page?
Adding interactivity and logic
Designing page structure
Styling web pages
Creating databases
JavaScript identifiers or names are:
Not case-sensitive
Always written in uppercase
Must start with digits
Case-sensitive
Which of the following identifiers is written in lower camel case?
last_name
LastName
lastName
LASTNAME
Which symbol is used to separate JavaScript statements?
;
.
,
:
Which of the following is NOT a valid way to output data in JavaScript?
.innerText
console.print()
window.alert()
document.write()
Which tag is used to include JavaScript code in HTML?
<style>
<a>
<js>
<script>
Where can you place JavaScript code in an HTML document?
Outside the HTML document
Only in <head>
Either <head> or <body>
Only in <body>
What does the command window.alert("Hello!") do?
Shows a pop-up alert box
Displays text inside an HTML element
Inserts text in the <body>
Prints to the console
Which of the following is NOT allowed in a JavaScript variable name?
name1
nameOne
1name
name_1
How do you write a multi-line comment in JavaScript?
/* comment */
// comment
## comment ##
<!-- comment -->
When was JavaScript created?
1993
1994
1995
1996
A programming language is mainly used to:
Give instructions and logic to the computer
Design the layout of a webpage
Store multimedia content
Style elements on a webpage
document.get (a) ("demo").innerText = "Hello!"
How do you write a single-line comment in JavaScript?
/* comment */
// comment
## comment ##
<!-- comment -->
What makes JavaScript code easier to read?
Using digits as variable names
Long lines
Adding white space
Removing comments
What are JavaScript instructions called?
Statements
Operators
Elements
Classes
How many statements are there in this line of code?
let x, y, z; x = 1; y = 4; z = x + y;
5
4
3
2
document.getElementById("sample"). (a) = "Hello!"
