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.
C because you already have you sheet prepared
Explanation:
it can take up a great deal of time in class.
it can be distracting in the middle of a lecture.
it can cause the student to miss information.
print(3+7) will output 10, which is an integer.
print("2+3") will output 2+3, which is a string.
<span>Phishing is a crime that uses mock (fake) sites to trick people into sharing information.</span>