I have a basic javascript question. This code seems to call a function inside the same function createEvent. But the function itself doesn't have any parameters inside, so how can it call the same function createEvent inside createEvent with the parameters title, start, and end?
function createEvent(calendarId) {
var cal = CalendarApp.getCalendarById(calendarId);
var title = 'Script Demo Event';
var start = new Date("April 1, 2012 08:00:00 PDT");
var end = new Date("April 1, 2012 10:00:00 PDT");
var desc = 'Created using Google Apps Script';
var loc = 'Script Center';
var event = cal.createEvent(title, start, end, {
description : desc,
location : loc
});
};
Can anyone here help me explain this?
createEventandcal.createEventare two different functions.