Javascript - var, functions, arrays, if

Javascript - var, functions, arrays, if

12th Grade

14 Qs

quiz-placeholder

Similar activities

Array+String

Array+String

10th Grade - University

16 Qs

Examen Tema 4 Array, Funciones y Objetos JavaScript

Examen Tema 4 Array, Funciones y Objetos JavaScript

12th Grade

15 Qs

KIỂM TRA  26

KIỂM TRA 26

9th - 12th Grade

10 Qs

Comandos essenciais JavaScript

Comandos essenciais JavaScript

1st Grade - University

10 Qs

PTS DMI

PTS DMI

12th Grade - University

10 Qs

Cumulative Test Practice Units 1, 3, 4, 5, & 7

Cumulative Test Practice Units 1, 3, 4, 5, & 7

9th - 12th Grade

17 Qs

Unit 8 Javascript Quiz

Unit 8 Javascript Quiz

9th - 12th Grade

15 Qs

Code.org List Questions

Code.org List Questions

9th - 12th Grade

10 Qs

Javascript - var, functions, arrays, if

Javascript - var, functions, arrays, if

Assessment

Quiz

Computers

12th Grade

Easy

Created by

Emmanuelle Arroyo

Used 2+ times

FREE Resource

14 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way of declaring a variable and assigning it to the value 10 ?

var a=10;

variable a:10;

var a:10;

var 10;

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax to declare a function named myFun ?

myFun(){

}

function myFun{

}

function myFun(){

}

function myFun(

)

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of creating functions?

to test a condition

to repeat some lines of code over and over

to execute some lines of code whenever you want

to execute lines of code when the page loads

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can we change the text of a paragraph with an id "myPara"?

document.getElementById("myPara").style.text="new text"

document.getElementById("myPara").text="new text"

document.getElementById("myPara").innerHTML="new text"

document.getElementById("myPara").value="new text"

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these correctly selects a paragraph with an id "myPara"?

getElementById("myPara")

document.getElementById("myPara")

document.getElementById( myPara )

document.Id("myPara")

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do we execute a function named myFunction?

myFunction{};

myFunction();

function myFunction()

myFunction;

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do we create an array "myArray "of 2 items "one" and "two"?

var myArray = ["one", "two"]

var myArray = [one, two]

array myArray = ["one", "two"]

myArray = "one", "two"

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?