You can return them in an object literal
function today_date() {
var t = new Date();
var day = t.getUTCDay();
var dayW = t.getDay(); // Day of de week (0-6).
return { "day" : day, "dayOfWeek" : dayW };
}
and access like this
function print_anything() {
console.log("Today is the " + today_date().day + " of the month.");
}
or you can return the values in an array:
function today_date() {
var t = new Date();
var day = t.getUTCDay();
var dayW = t.getDay(); // Day of de week (0-6).
return [ day, dayW ];
}
and then access the first one like this
function print_anything() {
console.log("Today is the " + today_date()[0] + " of the month.");
}