![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 12.07.2019 02:00 alaj6878
Will give brainliest and good amount of points, no false answers. i am using javascript for school and i still have no idea what i am doing. can someone ? the instructions are, a key step in many sorting algorithms (including selection sort) is swapping the location of two items in an array. here's a swap function that looks like it might work, but doesn't: -the code prints out [9, 9, 4] when it should print out [9, 7, 4]. fix the swap function. hint: work through the code line by line, writing down the values of items in the array after each step. could you use an extra temporary variable to solve the problem that shows up? once implemented, uncomment the program. assertequal() at the bottom to verify that the test assertion passes. the layout for javascript is, var swap = function(array, firstindex, secondindex) { array[firstindex] = array[secondindex]; array[secondindex] = array[firstindex]; }; var testarray = [7, 9, 4]; swap(testarray, 0, 1); println(testarray); //program. assertequal(testarray, [9, 7, 4]);
![ansver](/tpl/images/cats/User.png)
Answers: 1
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 02:30, chaaaa
People with high self-esteem: accept their strengths and weaknesses. believe that failed experiences are failures of their whole self. feel good about who they are only when they reach total success. need positive external experiences to counteract negative feelings that constantly plague them.
Answers: 1
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 20:30, maryanapritchak1829
If chris has a car liability insurance, what damage would he be covered for
Answers: 1
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 23:30, jamalchris9353
Worth 50 points answer them bc i am not sure if i am wrong
Answers: 1
You know the right answer?
Will give brainliest and good amount of points, no false answers. i am using javascript for school a...
Questions in other subjects:
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/en.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 27.05.2021 19:10
![Konu](/tpl/images/cats/en.png)
English, 27.05.2021 19:10
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 27.05.2021 19:10
![Konu](/tpl/images/cats/es.png)
Spanish, 27.05.2021 19:10
![Konu](/tpl/images/cats/biologiya.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 27.05.2021 19:10
![Konu](/tpl/images/cats/himiya.png)
Chemistry, 27.05.2021 19:10