return multiple values in javascript
function getNames() {
// get names from the database or API
let firstName = 'John',
lastName = 'Doe';
// return values
return {
firstName,
lastName
};
}
return multiple values in javascript
function getNames() {
// get names from the database or API
let firstName = 'John',
lastName = 'Doe';
// return values
return {
firstName,
lastName
};
}
return two arrays javascript
this.runThisFunctionOnCall = function(){
var array1 = [11,12,13,14,15];
var array2 = [21,22,23,24,25];
var array3 = [31,32,33,34,35];
return [
array1,
array2,
array3
];
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us