What does the following code snippet do? function add(x, y) { return x + y; }
console.log(add(5, 3));
JAVASCRIPT-STRING,ARRAYS,FUNCTIONS
Quiz
•
Computers
•
University
•
Medium
anispremkoilraj p
Used 3+ times
FREE Resource
75 questions
Show all answers
1.
FILL IN THE BLANK QUESTION
1 min • 1 pt
What does the following code snippet do? function add(x, y) { return x + y; }
console.log(add(5, 3));
2.
FILL IN THE BLANK QUESTION
1 min • 1 pt
NOT a valid way to pass arguments to a function?
3.
FILL IN THE BLANK 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();
4.
FILL IN THE BLANK 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);
5.
FILL IN THE BLANK QUESTION
1 min • 1 pt
What will be the output of the following code? let arr = [1, 2, 3]; console.log(arr[3]);
6.
FILL IN THE BLANK 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]);
7.
FILL IN THE BLANK 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);
78 questions
MORE ON SCRATCH
Quiz
•
5th Grade - University
71 questions
Review Alstrudat
Quiz
•
University
70 questions
ID and Access Management
Quiz
•
10th Grade - University
80 questions
Computer grade10
Quiz
•
10th Grade - University
70 questions
Soal UTS Pemrograman Mobile
Quiz
•
University
76 questions
MortalKombyte
Quiz
•
University - Professi...
74 questions
PRETEST 10
Quiz
•
10th Grade - University
75 questions
PYTHON CERT REVIEWER
Quiz
•
University
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade