Search Header Logo

JAVASCRIPT-STRING,ARRAYS,FUNCTIONS

Authored by anispremkoilraj p

Computers

University

Used 3+ times

JAVASCRIPT-STRING,ARRAYS,FUNCTIONS
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

75 questions

Show all answers

1.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

What does the following code snippet do? function add(x, y) { return x + y; }

console.log(add(5, 3));



(a)  

2.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

NOT a valid way to pass arguments to a function?

(a)  

3.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

What will the following code output? function foo() { var x = 10; if (true) { var x = 20; console.log(x); } console.log(x); } foo();

(a)  

4.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

What is the result of the following code? function sayName(name) { console.log("Hello, " + name); } var greeting = sayName("John"); console.log(greeting);

(a)  

5.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

What will be the output of the following code? let arr = [1, 2, 3]; console.log(arr[3]);

(a)  

6.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

What will be the output of the following code? let arr = [1, 2, 3]; arr.length = 1; console.log(arr[2]);

(a)  

7.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

What will be the output of the following code? let arr = [1, 2, 3]; arr[5] = 6; console.log(arr.length);

(a)  

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

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

Already have an account?