Printing to the console in Google Apps Script?

前端 未结 7 822
迷失自我
迷失自我 2021-01-31 01:13

I am very new to programming (have taken some of the JS courses on Codecademy). I am trying to create a simple script to determine, if given a spreadsheet with results from a po

7条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-31 01:44

    The console is not available because the code is running in the cloud, not in your browser. Instead, use the Logger class provided by GAS:

    Logger.log(playerArray[3])
    

    and then view the results in the IDE under View > Logs...

    Here's some documentation on logging with GAS.

    Edit: 2017-07-20 Apps script now also provides Stackdriver Logging. View these logs in the script editor under View - Console Logs.

提交回复
热议问题