ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 74 - Certified JavaScript Developer I discussion

Report
Export

Refer to the following array:

Let arr1 = [ 1, 2, 3, 4, 5 ];

Which two lines of code result in a second array, arr2 being created such that arr2 is not a reference to arr1?

A.
Let arr2 = arr1.slice(0, 5);
Answers
A.
Let arr2 = arr1.slice(0, 5);
B.
Let arr2 = Array.from(arr1);
Answers
B.
Let arr2 = Array.from(arr1);
C.
Let arr2 = arr1;
Answers
C.
Let arr2 = arr1;
D.
Let arr2 = arr1.sort();
Answers
D.
Let arr2 = arr1.sort();
Suggested answer: A, B
asked 23/09/2024
Zafor Iqbal
35 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first