How we can return more than one values from JavaScript function?
Just return an object.
return { a:1, b:2 };
You could return an array:
function() {
return [a, b];
}
Or an object:
function() {
return {a: a, b: b};
}
Or assign values to an input:
function(ref) {
ref.a = a;
ref.b = b;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With