
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
Noun clauses with Wh- words and If/Whether

Quiz
•
University
10 questions
Gerunds and Infinitives

Quiz
•
University
13 questions
Nhóm 11 - Đảm bảo an ninh trong môi trường TMĐT

Quiz
•
University
11 questions
C1 - Phrasal Verbs

Quiz
•
10th Grade - Professi...
10 questions
REPORTED SPEECH - reporting verbs.

Quiz
•
University
15 questions
Directions

Quiz
•
Professional Development
10 questions
TOEIC LR INTRO

Quiz
•
University
15 questions
causative verb

Quiz
•
7th Grade - Professio...
Popular Resources on Wayground
15 questions
Hersheys' Travels Quiz (AM)

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
30 questions
Lufkin Road Middle School Student Handbook & Policies Assessment

Quiz
•
7th Grade
20 questions
Multiplication Facts

Quiz
•
3rd Grade
17 questions
MIXED Factoring Review

Quiz
•
KG - University
10 questions
Laws of Exponents

Quiz
•
9th Grade
10 questions
Characterization

Quiz
•
3rd - 7th Grade
10 questions
Multiply Fractions

Quiz
•
6th Grade