wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

HTML, CSS, Terminal & JavaScript

Total questions: 20

Worksheet time: 7mins

Name
Class
Date
1.

What is the correct syntax for a function in JavaScript?

a)

def myFunction(){}

b)

function myFunction(){}

c)

function(){}

d)

create function myFunction(){}

2.

How do you apply flexbox to an element?

a)

display: flex;

b)

flex: 1;

c)

align-items: center;

d)

justify-content: space-between;

3.

What is the default display property of the

tag?

a)

inline

b)

block

c)

flex

d)

grid

4.

What is the purpose of HTML?

a)

To style web content

b)

To structure web content

c)

To add interactivity to web pages

d)

To create server-side applications

5.

How can you make a font bold in CSS?

a)

font-weight: bold;

b)

font-style: bold;

c)

text-weight: bold;

d)

font-bold: true;

6.

What is the command to rename files in your terminal?

a)

b)

c)

d)

7.

How do you specify a favicon in an HTML document?

a)

b)

c)

d)

8.

What is the correct way to add a comment in HTML?

a)

<!-- This is a comment -->

b)

<comment> This is a comment </comment>

c)

// This is a comment

d)

# This is a comment

9.

What will console.log(2 + "2") output?

a)

22

b)

4

c)

2

d)

undefined

10.

Which of the following represents the strict inequality operator?

a)

!

b)

==

c)

!==

d)

==!

11.

How do you apply a class in CSS?

a)

#classname {}

b)

.classname {}

c)

classname {}

d)

@classname {}

12.

How do you call a function named "myFunction" ?

a)

myFunction()

b)

call myFunction;

c)

execute myFunction;

d)

invoke myFunction()

13.

Which CSS property is used to change the text color?

a)

font-color

b)

text-color

c)

color

d)

background-color

14.

What will typeof([]) return in JavaScript?

a)

string

b)

array

c)

object

d)

function

15.

Which of the following is the correct syntax for string interpolation in JavaScript?

a)

"Hello, ${name}"

b)

'Hello, ${name}'

c)

`Hello, ${name}`

d)

'Hello, &{name}'

16.

What tag is used to create an unordered list?

a)

b)

c)

  • d)

    17.

    newString ="" is pointing to a falsey value

    a)

    True

    b)

    False

    c)

    Undefined

    d)

    Null

    18.

    How do you apply a CSS class to a HTML element?

    a)

    class='classname'

    b)

    style='classname'

    c)

    id='classname'

    d)

    css-class='classname'

    19.

    Which one of the following is not a shell?

    a)

    Bash

    b)

    Zsh

    c)

    PowerShell

    d)

    None of the above

    20.

    How do you add a single line comment in JavaScript?

    a)

    b)

    # comment

    c)

    // comment

    d)

    /* comment */