Answer the question
In order to leave comments, you need to log in
How to change an external variable passed to a function?
I have a possibly interesting question.
There is a task in the tutorial Function min(a, b) .
Very unpretentious.
But I decided to complicate it. I took not 2 but 4 numbers.
let A = +prompt('A =', ''),
B = +prompt('B =', ''),
C = +prompt('C =', ''),
D = +prompt('D =', '');
function Minmax(X,Y){
let i,result;
if (X > Y) {
i = X;
X = Y;
Y = i;
}
result = `min = ${X}, max = ${Y}`;
return result;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question