1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ivann1987 [24]
4 years ago
5

Will give brainliest and good amount of points, no false answers.

Computers and Technology
1 answer:
nlexa [21]4 years ago
7 0

The problem with the swap function is that it loses the value at the first index, as soon as it gets overwritten by the value at the second index. This happens in the first statement. To fix it, you need a helper variable.

First you're going to "park" the index at the first index in that helper variable, then you can safely overwrite it with the value at the second index. Then finally you can write the parked value to the second index:

var swap = function(array, firstIndex, secondIndex) {

let helper = array[firstIndex];

array[firstIndex]  = array[secondIndex];

array[secondIndex] = helper;

};

I hope this makes sense to you.

You might be interested in
Why header files are needed in every c program ?expalin​
bonufazy [111]

Answer:

Header files serve two purposes. System header files declare the interfaces to parts of the operating system. You include them in your program to supply the definitions and declarations you need to invoke system calls and libraries.

6 0
3 years ago
During the design phase, development teams translate the requirements into?
Ludmilka [50]
A design for the software application
7 0
3 years ago
Simon is working with his school newspaper to create the front page. What software is best used for page layout design?.
svlad2 [7]

Answer:

Adobe Indesign.

Explanation:

Adobe indesign is a typesetting and desktop publishing application used to create posters, newspapers, flyers, brochures, magazines, presentations, book and ebook etc.

It is a package from the Creative cloud adobe system packages. It has predetermined templates for newspaper pages (if newpaper is to published), and plug-ins to further customize the the layout of the newspaper to be created or published.

3 0
3 years ago
What is custom software
Kobotan [32]
A custom sofware is a computer program or website written <span>specifically for your company,</span>
4 0
4 years ago
Read 2 more answers
Write an If...Then statement that assigns 0 to intX when intY is equal to 20
BigorU [14]

Answer:

wh,,what?

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • Which activity represents a violation of the licensing agreement
    7·2 answers
  • ________ is typically used as the last string of letters in the name of a website. Group of answer choices the name of the indiv
    13·1 answer
  • Which of these is a social consequence of effective communication
    12·1 answer
  • Cookies are to improve the access of internet information. Therefore for the sake of you own privacy and security you should not
    8·2 answers
  • Using the __________ option, you can change the state of a model back to where a particular feature or features weren`t yet crea
    7·1 answer
  • If a= ‘ Stay home, Stay safe’ , print its value
    9·1 answer
  • In the Unified Process (UP) methodology, most of the Implementation activities occurs during the _____ phase.
    14·1 answer
  • Normalization works through a series of stages called normal forms. For most purposes in business database design, _____ stages
    7·2 answers
  • Information about www
    14·1 answer
  • Suppose in an Excel spreadsheet, the value in cell A1 is 25. By using the Macabacus local currency cycle shortcuts (Ctrl + Shift
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!