
MD1-Bài 10 - Mảng JS

Quiz
•
English
•
University - Professional Development
•
Hard
kiếm mãi
Used 34+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Cho biết giá trị của các biến a và b sau khi thực hiện đoạn mã sau?
let x = [3,5,6,9];
let a = 0, b = 0;
for(let y in x){
if(y % 2 != 0) {
a+=y;
b++;
}
console.log(a);
console.log(b)
013
2
4
2
13
2
02
2
2.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Cho biết phần tử cuối cùng của mảng a là gì sau khi thực hiện đoạn mã sau?
let a = ["John", "Mary", "Caly", "Tomy"];
a.sort();
Caly
Tomy
Mary
John
3.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Đoạn mã sau in ra kết quả gì?
let a = [1,2,3,4,5,6,7,8,9];
let b = [];
a[9] = b[0];
console.log(a[9]);
0
undefined
9
null
4.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Sau khi thực hiện đoạn mã sau thì mảng a sẽ có giá trị là:
let a = [1,9,3,2];
for(let i=0;i<a.length-1;i++){
for(let j=i+1;j<a.length;j++){
if(a[i] > a[j]){
let x = a[i];
a[i] = a[j];
a[j] = x; }
}
}
[1,9,3,2]
[1,2,3,9]
[2,3,9,1]
[9,3,2,1]
5.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Sau khi thực hiện đoạn mã sau thì mảng a sẽ có giá trị là:
let a = [1,9,3,2];
for(let i=0;i<a.length-1;i++){
for(let j=i+1;j<a.length;j++){
if(a[i] < a[j]){
let x = a[i];
a[i] = a[j];
a[j] = x; }
}
}
[1,2,3,9]
[2,3,9,1]
[9,3,2,1]
[1,9,3,2]
6.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Sau khi đoạn mã sau được thực hiện thì giá trị các phần tử của mảng a là:
let a = [4, 3, 5];
a[2] = a[1] * 4;
a[1] *= a.length;
[4,9,5]
[4,9,16]
[4,3,5]
[4,9,12]
7.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Đoạn mã sau xuất ra kết quả trên màn hình là gì?
let x = [5, 6, 7, 8];
for(let a in x){
if(x[a] % 2 == 0){
break;
}
console.log(a);
}
0
5
1
2
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Causative get, have, make, let

Quiz
•
University
15 questions
Let's Build a Park

Quiz
•
11th Grade - University
10 questions
Quizzizz Tiểu học

Quiz
•
Professional Development
10 questions
MAKING SUGGESTIONS

Quiz
•
1st Grade - University
13 questions
Collocations

Quiz
•
University
12 questions
Phrasal verbs

Quiz
•
University
10 questions
Causative verbs

Quiz
•
University
15 questions
offers, suggestions and requests

Quiz
•
6th Grade - University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Appointment Passes Review

Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
Grammar Review

Quiz
•
6th - 9th Grade