如何在 google 日历 api 中检查事件是否没有摘要?

How to check if event has no summary, in google calnedar api?

这是请求事件信息的代码,摘要似乎并没有真正做任何事情,已经尝试过:if (request.summary = 0) {...但我认为这是错误的并且没有给出结果。

我想要的是:如果事件没有摘要,而不是 "undefined" 它会打印出定义的消息。

有什么想法吗?

function GRN() {
    var request = gapi.client.calendar.events.list({
      'calendarId': 'MycalendarID',
      'timeMin': (new Date()).toISOString(),
      'showDeleted': false,
      'singleEvents': true,
      'summary': ,
      'maxResults': 5,
      'orderBy': 'startTime',
      'timeMax':(new Date(tomorrow)).toISOString(),
    });
if(typeof request.summary == 'undefined') { ... }

或者

if(!request.summary) { ... }

让它像这样工作,thnx @Sojtin 寻求帮助:)

          if(!event.summary) { 
          event.summary = 'opptatt'
          }