Jump to content


Photo

Details for login

node.js node-steamcommunity

Best Answer Dr. McKay , 12 August 2017 - 04:32 AM

details is not yet defined.

Go to the full post


  • Please log in to reply
5 replies to this topic

#1 HromaCool

HromaCool

    Newbie

  • Member
  • Pip
  • 7 posts

Posted 11 August 2017 - 09:34 AM

How i can fill details with a variable?

For example:

 

var log = "example1";

var pasw = "example2";

 

      var details = {
    "accountName": log,
    "password": pasw,
};

 When i  try to run it shows me that

 

 "accountName": log,
                   ^
 
ReferenceError: log is not defined

 



#2 xLeeJYx

xLeeJYx

    Advanced Member

  • Member
  • PipPipPip
  • 70 posts

Posted 11 August 2017 - 10:55 AM

why not just make a config file ?



#3 HromaCool

HromaCool

    Newbie

  • Member
  • Pip
  • 7 posts

Posted 11 August 2017 - 12:45 PM

i have a file with logins and passwords...



#4 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,363 posts

Posted 11 August 2017 - 08:07 PM

The way you've written it here is correct. The error indicates that you're trying to access the variable outside of the scope where it was defined.



#5 HromaCool

HromaCool

    Newbie

  • Member
  • Pip
  • 7 posts

Posted 12 August 2017 - 12:49 AM

The way you've written it here is correct. The error indicates that you're trying to access the variable outside of the scope where it was defined.

But when i "fix" it shows me:

 

 if (!details.accountName || !details.password) {
                    ^
 
TypeError: Cannot read property 'accountName' of undefined


#6 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,363 posts

Posted 12 August 2017 - 04:32 AM   Best Answer

details is not yet defined.







Also tagged with one or more of these keywords: node.js, node-steamcommunity

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users