function that return two values javascript code example
Example: return multiple values in javascript
function getNames() {
// get names from the database or API
let firstName = 'John',
lastName = 'Doe';
// return values
return {
firstName,
lastName
};
}