Search Header Logo

Kuizi 12 - Web

Authored by Shkodran Hasani

Computers

10th Grade

Kuizi 12 - Web
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax for an if statement in JavaScript?

if condition { // code to execute }

if (condition) // code to execute

if (condition) { // code to execute }

if { condition } // code to execute

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you write an if-else statement?

if (condition) { // code } else if { // code }

if condition then { // code } else { // code }

if (condition) { // code to execute if condition is true } else { // code to execute if condition is false }

if (condition) { // code } else { // execute code }

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code output: if (5 > 3) { console.log('True'); }?

Error

Undefined

False

True

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of a switch statement?

To define a variable's scope

To handle exceptions in programming

To create loops in code

The purpose of a switch statement is to execute different code blocks based on the value of a variable or expression.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you define a default case in a switch statement?

Use 'case default:' to define the default case.

You can omit the default case entirely in a switch statement.

Use 'default:' followed by the code block.

The default case is defined with 'default_case:' syntax.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following switch statement output: switch (2) { case 1: console.log('One'); break; case 2: console.log('Two'); break; }?

Two

One

Zero

Three

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax for a ternary operator?

condition ? result_if_false : result_if_true

result_if_true : condition ? result_if_false

result_if_true ? result_if_false : condition

condition ? result_if_true : result_if_false

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?