Question: Consider the following piece of JavaScript: function swap ( array , index 1 , index 2 ) { var index 2 ] ; array [
Consider the following piece of JavaScript:
function swaparrayindexindex
var index;
arrayindex arrayindex;
array index;
return array;
var arr;
swap arr;
swap arr;
console.logarr;
What is printed to the console?
Rremember that in JavaScript arrays, the first index is
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
