Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8590545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:19:05+00:00 2026-06-11T23:19:05+00:00

Back in 2012, I had some Google Apps Script code for a poker game:

  • 0

Back in 2012, I had some Google Apps Script code for a poker game:

function addplayerstoArray(numplayers) {
  
  var playerArray = [];
  
  for (i=0; i<numplayers; i++) {
    playerArray.push(i);
  }
}  

addplayerstoArray(7);

console.log(playerArray[3])

The idea is to create an array with the total number of players in it. When running the code, I thought it would print "3" to the console. But nothing happened. It said

"ReferenceError: "console" is not defined."

A) How does the Google Apps Script console work? Where can I see if my code is accomplishing what I’d like?

B) Is it a problem with the code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:19:06+00:00Added an answer on June 11, 2026 at 11:19 pm

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Back in MVC3, I had a custom ControllerFactory which would use my own container
Back in college I wrote a game where the computer would sleep for 1
back in school, we wrote a compiler where curly braces had the default behavior
I was doing some work on a wordpress site and another programmer had also
Following code create that Annotation. As described here, http://engineering.webengage.com/2012/03/12/a-peek-into-webengages-security-layer-super-cool-use-of-java-annotations /** * Defining the Asynch
I got access to Visual studio 2012 a couple of days back and I
I have this problem converting java.sql.Timestamp.toString back to java.sql.Timestamp . Given element = 2012-08-01
Here is the code: string s = 2012-08-08T01:54:45.3042880+00:00; JObject j1 = JObject.FromObject(new { time=s
I have an update_recordset call in my code, and I'd like to echo back
Back in the old days, Help was not trivial but possible: generate some funky

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.