These are chat archives for FreeCodeCamp/Help

11th
Oct 2017
Derek
@dsoucie
Oct 11 2017 01:24
what image search APIs are you guys using for the Backend image search abstraction layer? I've spent all day looking for a good api to use that isn't a headache to sign up for a key.
Albert Cardona II
@daddycardona
Oct 11 2017 02:13
for what @dsoucie
sorry so late?
Darren
@DarrenfJ
Oct 11 2017 05:28
evening fCC
ooo slow night
Henry
@GitHub-Henry
Oct 11 2017 05:29
@DarrenfJ hello
Darren
@DarrenfJ
Oct 11 2017 05:29
@GitHub-Henry helloHello
how goes the coding?
Henry
@GitHub-Henry
Oct 11 2017 05:29
@DarrenfJ a slow march
how about you
Darren
@DarrenfJ
Oct 11 2017 05:33
me too.. sorta want to jump into P1xt's CSS prep for a nov challenge but uninspired to do anything but that very basics
Fabien SHAN
@X140hu4
Oct 11 2017 05:38
Hi guys
Darren
@DarrenfJ
Oct 11 2017 05:41
@X140hu4 hello hello :D
Fabien SHAN
@X140hu4
Oct 11 2017 05:45
what is this CSS prep you are talking about?
Darren
@DarrenfJ
Oct 11 2017 05:46
um, it's a challenge form a person who was very active in the fCC forums a while ago
can pull a link for you
gimme a sec
ok this is the recommended links to vids etc to *prep8 for her challenge
ok guys thanks for the chat... gonna go watch vids..
thanks @X140hu4 @GitHub-Henry
CamperBot
@camperbot
Oct 11 2017 05:48
darrenfj sends brownie points to @x140hu4 and @github-henry :sparkles: :thumbsup: :sparkles:
:cookie: 291 | @x140hu4 |http://www.freecodecamp.com/x140hu4
:cookie: 384 | @github-henry |http://www.freecodecamp.com/github-henry
Darren
@DarrenfJ
Oct 11 2017 05:48
and my usual thanks to the regulars
Fabien SHAN
@X140hu4
Oct 11 2017 05:48
I am doing one of her guides haha
didnt know she had a medium
Darren
@DarrenfJ
Oct 11 2017 05:49
thanks @Manish-Giri @daddycardona @ahmedtarek2134 @ericmiller777 @sjames1958gm @Marmiz @khaduch @heroiczero
CamperBot
@camperbot
Oct 11 2017 05:49
darrenfj sends brownie points to @manish-giri and @daddycardona and @ahmedtarek2134 and @ericmiller777 and @sjames1958gm and @marmiz and @khaduch and @heroiczero :sparkles: :thumbsup: :sparkles:
Fabien SHAN
@X140hu4
Oct 11 2017 05:49
thanks @DarrenfJ
CamperBot
@camperbot
Oct 11 2017 05:49
x140hu4 sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:cookie: 317 | @ericmiller777 |http://www.freecodecamp.com/ericmiller777
:cookie: 380 | @daddycardona |http://www.freecodecamp.com/daddycardona
:star2: 1061 | @marmiz |http://www.freecodecamp.com/marmiz
:star2: 1861 | @heroiczero |http://www.freecodecamp.com/heroiczero
:star2: 6640 | @manish-giri |http://www.freecodecamp.com/manish-giri
:star2: 3358 | @khaduch |http://www.freecodecamp.com/khaduch
:cookie: 586 | @ahmedtarek2134 |http://www.freecodecamp.com/ahmedtarek2134
:star2: 8539 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
:star2: 2115 | @darrenfj |http://www.freecodecamp.com/darrenfj
Darren
@DarrenfJ
Oct 11 2017 05:49
@X140hu4 yah her guides are amazing aren't they
Eric Miller
@ericmiller777
Oct 11 2017 05:49
@DarrenfJ thanks
CamperBot
@camperbot
Oct 11 2017 05:49
ericmiller777 sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2116 | @darrenfj |http://www.freecodecamp.com/darrenfj
Darren
@DarrenfJ
Oct 11 2017 05:50
stumbled on her blog a while back and was very exciting to do the CSS challenge but this week not into coding at all
i have just enough excitement to do the absolute min (which in for me a 100 day challenge where i do one Codecademy exercise and try to do one codewars kata per day)
Fabien SHAN
@X140hu4
Oct 11 2017 05:51
Oh :( what is happening?
Md. Nazmul Hoque
@nazmulhooque
Oct 11 2017 07:54

The global var should be overwritten with the local and it does, but in the end I get the error that i changed the global var and does not let me complete the assignment. Here is the code:

// Setup
var outerWear = "T-Shirt";

function myOutfit() {
// Only change code below this line

outerWear = "sweater";

// Only change code above this line
return outerWear;
}

myOutfit();

Claudio Restifo
@Marmiz
Oct 11 2017 08:33

@nazmulhooque If I recall correctly the challenge ask you to not modify the global variable value. Am I right?

If so, your challenge is failing in doing so, you are in fact assigning a new value to it

gishy1
@gishy1
Oct 11 2017 08:35
hello world
i need to undesrstand something
if (str===str.reverse("")) why is this not a function?
please get back to me
Fabien SHAN
@X140hu4
Oct 11 2017 08:39
What do you mean?
gishy1
@gishy1
Oct 11 2017 08:39
when i try to run this]
function palindrome(str) {
if (str===str.reverse(""))
{
return true;
}
else return false;
}
it tells me
str.reverse is not a function
im rying to figure out why
trying *
Fabien SHAN
@X140hu4
Oct 11 2017 08:43
You are trying to do it on a string
gishy1
@gishy1
Oct 11 2017 08:46
@X140hu4 ok so it can only be done on an array correct ?
Fabien SHAN
@X140hu4
Oct 11 2017 08:46
yes
walsr_
@walsrlsraw
Oct 11 2017 09:03
设置段落的字号在哪个位置啊?
新手...
Fabien SHAN
@X140hu4
Oct 11 2017 09:05
会英语吗?
gishy1
@gishy1
Oct 11 2017 09:06
@X140hu4 Thanks bro!!!!!!!
CamperBot
@camperbot
Oct 11 2017 09:06
gishy1 sends brownie points to @x140hu4 :sparkles: :thumbsup: :sparkles:
:cookie: 293 | @x140hu4 |http://www.freecodecamp.com/x140hu4
heroiczero
@heroiczero
Oct 11 2017 10:08
@X140hu4 @DarrenfJ @GitHub-Henry @daddycardona @ericmiller777 @sjames1958gm @Manish-Giri @Marmiz :wave: TY
CamperBot
@camperbot
Oct 11 2017 10:08
heroiczero sends brownie points to @x140hu4 and @darrenfj and @github-henry and @daddycardona and @ericmiller777 and @sjames1958gm and @manish-giri and @marmiz :sparkles: :thumbsup: :sparkles:
:cookie: 294 | @x140hu4 |http://www.freecodecamp.com/x140hu4
:cookie: 381 | @daddycardona |http://www.freecodecamp.com/daddycardona
:cookie: 385 | @github-henry |http://www.freecodecamp.com/github-henry
:star2: 2117 | @darrenfj |http://www.freecodecamp.com/darrenfj
:star2: 6641 | @manish-giri |http://www.freecodecamp.com/manish-giri
:cookie: 318 | @ericmiller777 |http://www.freecodecamp.com/ericmiller777
:star2: 1062 | @marmiz |http://www.freecodecamp.com/marmiz
:star2: 8540 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
libentboniphace
@libentboniphace
Oct 11 2017 10:11

<script> $(document).ready(funtion(){

});</script> this do not work I get this massage when I run the test SyntaxError: missing ) after argument list

popej
@popej
Oct 11 2017 10:12
hello campers, I have a problem with coding a grid on mailing, could any1 help?
korzo
@korzo
Oct 11 2017 10:15
@popej are you coding your own grid for mail?
@libentboniphace you have funtion instead of function
popej
@popej
Oct 11 2017 10:19
@korzo i am trying to
korzo
@korzo
Oct 11 2017 10:20
@popej Wouldn't be easier to use some existing framework for that?
Coding mail is very hard because of limited support and all inconsistencies
popej
@popej
Oct 11 2017 10:21
@korzo check priv
Georgia
@georgiawang5332
Oct 11 2017 12:08
image.png
Can you ask which side is wrong?
(((plz
Because I do not know which side of the program to write a problem, can guide me step by step?
heroiczero
@heroiczero
Oct 11 2017 12:23
@georgiawang5332 you forgot the case 2 and 22 ends with nd and case 3 and 23 ends with rd
Georgia
@georgiawang5332
Oct 11 2017 12:38
@heroiczero thank u
CamperBot
@camperbot
Oct 11 2017 12:38
georgiawang5332 sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1862 | @heroiczero |http://www.freecodecamp.com/heroiczero
Henry
@GitHub-Henry
Oct 11 2017 12:41
@heroiczero hello and thank you for the brownies
CamperBot
@camperbot
Oct 11 2017 12:41
github-henry sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1863 | @heroiczero |http://www.freecodecamp.com/heroiczero
Ken Haduch
@khaduch
Oct 11 2017 12:47
@georgiawang5332 - one helpful tip on posting code here - use the markdown format. You can read the details here. Basically, make a line with only three backticks ``` before and after your code block. It's easier to read here in the chat room...
Georgia
@georgiawang5332
Oct 11 2017 14:34
Is there an answer to the question? I think the idea is a bit messy
have the answer ? plz help me.....
image.png
Henry
@GitHub-Henry
Oct 11 2017 14:44
@georgiawang5332 The FCC Chinese chat might help cross the language barrier
Georgia
@georgiawang5332
Oct 11 2017 14:44
image.png
image.png
@GitHub-Henry OKOKthx
Does anyone have the answer to this question, can you give me a study? The Friendly Date Ranges 
I would like to say first understand your answer, and then I do this title ---> Friendly Date Ranges <---, and then provided to me, disturbed!
Eric Miller
@ericmiller777
Oct 11 2017 16:02
@heroiczero thanks
CamperBot
@camperbot
Oct 11 2017 16:02
ericmiller777 sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1864 | @heroiczero |http://www.freecodecamp.com/heroiczero
knight2
@knight2
Oct 11 2017 16:52
anyone experienced with mongoose and mongodb?
specifically with saving instances of schemas
knight2
@knight2
Oct 11 2017 17:07
i'm having issues with creating a record of model and saving it with mongoose
var mongoose = require('mongoose')
mongoose.connect(process.env.mLAB)   


var Schema = mongoose.Schema;

var personSchema = new Schema({
  name: String,
  age: Number,
  favoriteFoods: [String]
}) 

var Person = mongoose.model("Person", personSchema);

var createAndSavePerson = function(done) {


var person = new Person({name:"Joe Smith", age: "14", favoriteFoods: ["apple", "carrot"]})
person.save(function(err){
  if (err) return handleError(err);
})
  done(null /*, data*/);
};
keeps failing the unit test saying Missing callback argument
knight2
@knight2
Oct 11 2017 17:12
mongoose documentation shows that just using,save() works fine
var thingSchema = new Schema({..})
var Thing = mongoose.model('Thing', thingSchema);
var thing = new Thing({ iAmNotInTheSchema: true });
thing.save(); // iAmNotInTheSchema is not saved to the db

// set to false..
var thingSchema = new Schema({..}, { strict: false });
var thing = new Thing({ iAmNotInTheSchema: true });
thing.save(); // iAmNotInTheSchema is now saved to the db!!
yet for some reason fcc makes things more complicated
Moisés Man
@moigithub
Oct 11 2017 17:20
move done inside the save callback @knight2
save is async
done tells ur test it finished the async operation
knight2
@knight2
Oct 11 2017 17:24
@moigithub ah i see, so now I have

var person = new Person({name:"Joe Smith", age: "14", favoriteFoods: ["apple", "carrot"]})
person.save(function(err){
  if (err) return handleError(err);
    done(null /*, data*/);
})
};
now it fails the test
saying
failed
Error: timeout
also when I runt he test the console logs
GET
1:24 PM
Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html
1:24 PM
GET
1:24 PM
and when I refresh my code console says
.env: line 10: dbuser: No such file or directory
1:25 PM
`open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instead, or set the `useMongoClient` option if using `connect()` or `createConnection()`. See http://mongoosejs.com/docs/connections.html#use-mongo-client
1:25 PM
🌥🌨 Your app is listening on port 3000
the line 10 it refers to is mLAB=mongodb://<dbuser>:<restofmydatabaselink
Moisés Man
@moigithub
Oct 11 2017 17:35
mongoose.Promise = global.Promise;
and.. u need to pass a config to ur connect
mongoose.connect(process.env.mLAB ,{useMongoClient: true} );
Dylan
@dhcodes
Oct 11 2017 17:52
@knight2 here's the code I've used to connect:
//Set up mongoose connection
var mongoose = require('mongoose');
var mongoDB = 'insert_your_database_url_here';
mongoose.connect(mongoDB, {
  useMongoClient: true
});
var db = mongoose.connection;
db.on('error', console.error.bind(console, 'MongoDB connection error:'));
where the url comes from your mlab instance
knight2
@knight2
Oct 11 2017 17:58
@moigithub when I do that, I get Error: Invalid mongodb uri. Missing hostname 1:58 PM
@dhcodes when I do that, I get MongoDB connection error: { [MongoError: Authentication failed.] 1:59 PM name: 'MongoError', 1:59 PM message: 'Authentication failed.', 1:59 PM ok: 0, 1:59 PM errmsg: 'Authentication failed.', 1:59 PM code: 18, 1:59 PM codeName: 'AuthenticationFailed' } 1:59 PM
dylan's suggestions:
var mongoose = require('mongoose')
mongoose.Promise = global.Promise;
//mongoose.connect(process.env.mLAB ,{useMongoClient: true} );

var mongoDB = "mongodb://<dbuser>:<dbpassword>@ds113825.mlab.com:13825/codetesting"
mongoose.connect(mongoDB, {
  useMongoClient: true
});
var db = mongoose.connection;
db.on('error', console.error.bind(console, 'MongoDB connection error:'));
and moises's suggestions:
var mongoose = require('mongoose')
mongoose.Promise = global.Promise;
mongoose.connect(process.env.mLAB ,{useMongoClient: true} );
what am I doing wrong :(
Kyle Holm
@thekholm80
Oct 11 2017 18:01
have you created a user & password for this database in mlab, and are you putting those credentials in your connection uri?
for example
var mongoDB = "mongodb://mrUser:12345@ds113825.mlab.com:13825/codetesting"
knight2
@knight2
Oct 11 2017 18:04
@thekholm80 ah I am obviously missing user/pass, i thought I just needed to copy/past the link on mlab (as FCC is missing the entire section on this part)
Kyle Holm
@thekholm80
Oct 11 2017 18:04
yep!
when you go into your databases's dashboard you should have a tab labeled "users"
then just add a new user
knight2
@knight2
Oct 11 2017 18:05
simple mistake is simple. Will retry basic stuff with new link, thanks @thekholm80 @dhcodes @moigithub for the suggestions/help
CamperBot
@camperbot
Oct 11 2017 18:05
knight2 sends brownie points to @thekholm80 and @dhcodes and @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 1501 | @thekholm80 |http://www.freecodecamp.com/thekholm80
:star2: 1838 | @dhcodes |http://www.freecodecamp.com/dhcodes
:star2: 3665 | @moigithub |http://www.freecodecamp.com/moigithub
knight2
@knight2
Oct 11 2017 18:19

okay finally made a user for database, changed my URL. did basic connect (not what the others suggested)

.env: line 10: usertesting1: No such file or directory``` and test fails with timeout

Retried moise's suggestion. same error occurs --- 
``` Error: Invalid mongodb uri. Missing hostname
2:18 PM
    at muri (/app/node_modules/muri/lib/index.js:40:11)
2:18 PM
    at NativeConnection.Connection.openUri (/app/node_modules/mongoose/lib/connection.js:742:18)
2:18 PM
    at Mongoose.connect (/app/node_modules/mongoose/lib/index.js:262:17)
2:18 PM
Jump to

retried dylan's suggestion:
MongoDB connection error: { [MongoError: Authentication failed.] 2:19 PM name: 'MongoError', 2:19 PM message: 'Authentication failed.', 2:19 PM ok: 0, 2:19 PM errmsg: 'Authentication failed.', 2:19 PM code: 18, 2:19 PM codeName: 'AuthenticationFailed' } 2:19 PM

Username and password for the database are correct, and made new user/pass for database to double check.
current code is
var mongoose = require('mongoose')
var mongoDB = 'mongodb://<usertesting2>:<userpass2>@ds113825.mlab.com:13825/codetesting';
mongoose.connect(mongoDB, {
  useMongoClient: true
}); 
var db = mongoose.connection;
db.on('error', console.error.bind(console, 'MongoDB connection error:'));
Kyle Holm
@thekholm80
Oct 11 2017 18:21
remove the <> around your username and password
unless that is part of the actual username and password
knight2
@knight2
Oct 11 2017 18:22
@thekholm80 wow lol. That fixes the errors
So it can connect to the db now
But for the test failed Error: Missing callback argument
var Person = mongoose.model("Person", personSchema);

var createAndSavePerson = function(done) {


var person = new Person({name:"Joe Smith", age: "14", favoriteFoods: ["apple", "carrot"]})
person.save(function(err){
  if (err) return handleError(err);
    done(null /*, data*/); 
})
};
GET
2:22 PM
Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html
2:22 PM
Missing `done()` argument
2:22 PM
GET
2:22 PM
Missing `done()` argument
2:22 PM
GET
2:22 PM
Missing `done()` argument
2:22 PM
Kyle Holm
@thekholm80
Oct 11 2017 18:23
I don't use mongoose, @moigithub or @dhcodes will have to help you
mongo is awesome, mongoose is a nightmare
knight2
@knight2
Oct 11 2017 18:25
why do we suggest using mongoose for the FCC mongoDB section then?
Kyle Holm
@thekholm80
Oct 11 2017 18:25
some people really like it
knight2
@knight2
Oct 11 2017 18:26
and what you do personally use instead of mongoose
Kyle Holm
@thekholm80
Oct 11 2017 18:26
i don't think i'm smart enough for mongoose lol
mongodb just makes sense to me, i don't get schema based systems
knight2
@knight2
Oct 11 2017 18:28

@moigithub @dhcodes connection issue to the mlab db fixed (never had user/pass properly put in the URI).

However on submitting the test for saving a record to the db, I still encounter the failed Error: Missing callback argument error

code 5 minutes timestamped above
Kyle Holm
@thekholm80
Oct 11 2017 18:28
you might try the backend room https://gitter.im/FreeCodeCamp/HelpBackEnd
there's some smart folks there
knight2
@knight2
Oct 11 2017 18:29
oh there is abackend room
i've been looking for this
Kyle Holm
@thekholm80
Oct 11 2017 18:29
:smile:
i think @alpox is there now, I'm pretty sure he uses mongoose
knight2
@knight2
Oct 11 2017 18:30
i've literally been searching for random discords/slack channels but none of them are backend centric
knight2
@knight2
Oct 11 2017 18:36
random question
why does my console keep saying '.env: line 10: usertesting3: No such file or directory'
which corresponds to mLAB=mongodb://<usertesting3>:<userpass3>@ds113825.mlab.com:13825/codetesting
That is the format we are told to put it in. why would it create a log message
Dylan
@dhcodes
Oct 11 2017 19:30
@knight2 are you doing <usertesting3> or usertesting3. You don't need the < > on either side; that's code-speak for inserting your own data there without the < >
Jerzz
@2cool4school
Oct 11 2017 19:37
Yo, I was wondering if anyone knew anything about the job market/job searching. I'm in the planning stages of my portfolio, and I was wondering whether using github pages or gitshowcase are acceptable platforms to present a portfolio to employers, or does that look lazy? Thoughts?
knight2
@knight2
Oct 11 2017 19:50
@dhcodes ah yeah had edit that in the myapp.js file but not in the env file. Maybe ill be the person to revise the mongo sectino of beta once I get through id xD. thanks!
CamperBot
@camperbot
Oct 11 2017 19:50
knight2 sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star2: 1840 | @dhcodes |http://www.freecodecamp.com/dhcodes
Manish Giri
@Manish-Giri
Oct 11 2017 19:57
@DarrenfJ @heroiczero @dhcodes @thekholm80 ty
CamperBot
@camperbot
Oct 11 2017 19:57
manish-giri sends brownie points to @darrenfj and @heroiczero and @dhcodes and @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 2118 | @darrenfj |http://www.freecodecamp.com/darrenfj
:star2: 1502 | @thekholm80 |http://www.freecodecamp.com/thekholm80
:star2: 1841 | @dhcodes |http://www.freecodecamp.com/dhcodes
:star2: 1865 | @heroiczero |http://www.freecodecamp.com/heroiczero
Joshua Arnett
@josha5
Oct 11 2017 19:59
Could anyone help me with finding empty squares on my tic tac toe project?
The logic for my function seems right but I cant get it to work
piteto
@piteto
Oct 11 2017 20:36

@josha5 Use a forEach or $.each in jQuery:

    $.each($(".cell"), function(i, cell) {
      if ($(this).text() == " ") emptyCells.push($(this).attr('id'));
    });

that results in the emptyCells array getting populated with the ID of every empty cell

Joshua Arnett
@josha5
Oct 11 2017 20:51
Its still pushing cells that have already been clicked
Stephen James
@sjames1958gm
Oct 11 2017 20:59
@josha5 Do you ever empty the array before checking?
Jerzz
@2cool4school
Oct 11 2017 21:32
@josha5 I don't exactly understand your problem?
@josha5 I would use an array representation of the board as the source of truth
@josha5 for example:
$(document).ready(function() {

  var board = ['','','','','','','','',''];

  $('.cell').on('click', function(){

    var cell = parseInt(this.id);

    if (board[cell] === '') {
      $('#' + cell).text('O');
      board[cell] = 'O';
    } else {
      alert('choose another square');
    }

  });
});
@josha5 and to clarify I changed the html of each cell so that id=0, id=1, ... , id=8 so that you can parse the int
Jerzz
@2cool4school
Oct 11 2017 21:40
@josha5 I see what your question is now but intuitively I would still use the array. You can check for empty squares by checking for indices of the array that equal ''
Kyle Holm
@thekholm80
Oct 11 2017 22:12
@Manish-Giri ty sir
CamperBot
@camperbot
Oct 11 2017 22:13
thekholm80 sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 6642 | @manish-giri |http://www.freecodecamp.com/manish-giri
David Chen
@Obiwan777
Oct 11 2017 22:57

hi guys quick question about python

import sys
def beforeFirst():
    set = ["--default","-d","access_log","access_log.1","access_log.2"]    
    if any(set in sys.argv):
        checkFirst()
    else:
        sys.exit("Error! Please provide the correct filename to " + sys.argv[0])

this one keeps giving me error, TypeError: 'bool' object is not iterable
anyone know how to fix it?

aRtoo
@artoodeeto
Oct 11 2017 23:02
hey guys for the calculator challenge are we allowed to use eval()
Uriel Guzmán
@Burinson
Oct 11 2017 23:16
image.png
I'm getting really stressed
Why am I doing wrong?
What*
Everything is undefined in the console
I saw a video and it said you could directly put the element in the console instead of doing "console.log(num)"
korzo
@korzo
Oct 11 2017 23:26
@Burinson did you check also Devtools console?
try to save and reload
Uriel Guzmán
@Burinson
Oct 11 2017 23:28
@korzo Yeah, Chrome devtools
It doesn't work anywhere
Do I need an extension or something?
This would save me lots of precious time
Stephen James
@sjames1958gm
Oct 11 2017 23:32
@artoodeeto Yeah, eval is used by lots of people
aRtoo
@artoodeeto
Oct 11 2017 23:33
@sjames1958gm yea. i might use it if this infix and postfix doesnt work
Uriel Guzmán
@Burinson
Oct 11 2017 23:39
@korzo Hm...
Then it must be a problem with my browser?
korzo
@korzo
Oct 11 2017 23:39
@Burinson try hard reload
Open devtools, right click on reload button and select empty cache and hard reload
Uriel Guzmán
@Burinson
Oct 11 2017 23:43
image.png
@korzo
I hard reloaded it and it still doesn't work
O.o
korzo
@korzo
Oct 11 2017 23:45
screenshot-codepen.io-2017-10-12-01-44-29-258.png
@Burinson
Manish Giri
@Manish-Giri
Oct 11 2017 23:46
he's asking how to access variables from the dev tools directly
without having to put console.log statements in the code
Uriel Guzmán
@Burinson
Oct 11 2017 23:46
@korzo That's not what I'm trying to do
@Manish-Giri This is what I'm trying to do
Manish Giri
@Manish-Giri
Oct 11 2017 23:46
@Burinson i tried it, it doesn't work for me too
Uriel Guzmán
@Burinson
Oct 11 2017 23:47
@Manish-Giri Do you personally debug with the classic console.log() method?
Manish Giri
@Manish-Giri
Oct 11 2017 23:48
not really, it's very tedious to do that. I just go to the "sources" tab, find the JS file, put a breakpoint and debug
@Burinson
korzo
@korzo
Oct 11 2017 23:48
@Burinson Oh, sorry
Uriel Guzmán
@Burinson
Oct 11 2017 23:49
@Manish-Giri https://www.youtube.com/watch?v=q9jAFZjPFHo This is where I found out about that method
@korzo .
Manish Giri
@Manish-Giri
Oct 11 2017 23:49
@Burinson I think - if you load in a plain HTML file in the browser directly, and run your JS in that, the approach might work
korzo
@korzo
Oct 11 2017 23:49
@Burinson to use it from console, you have to select right frame in top left
Manish Giri
@Manish-Giri
Oct 11 2017 23:49
I have a feeling codepen creates a wrapper, so you can't access
Uriel Guzmán
@Burinson
Oct 11 2017 23:50
Check minute 4:14
Manish Giri
@Manish-Giri
Oct 11 2017 23:50
but I might be wrong
Uriel Guzmán
@Burinson
Oct 11 2017 23:50
He has a weird blank page above the dev console
He reloads it
korzo
@korzo
Oct 11 2017 23:50
:point_up: October 12, 2017 1:49 AM @Burinson
Codepen(index.html)
It works then
image.png
Uriel Guzmán
@Burinson
Oct 11 2017 23:54
@korzo Okay, that worked, thanks
CamperBot
@camperbot
Oct 11 2017 23:54
burinson sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 617 | @korzo |http://www.freecodecamp.com/korzo
Uriel Guzmán
@Burinson
Oct 11 2017 23:54
But for example, if you put "a", why does it give you an error?
for the var a
korzo
@korzo
Oct 11 2017 23:55
@Burinson Isn't a inside the function ?
Uriel Guzmán
@Burinson
Oct 11 2017 23:55
yeah
korzo
@korzo
Oct 11 2017 23:56
You have access to global scope, but not to local function scope
Uriel Guzmán
@Burinson
Oct 11 2017 23:57
Damn, so you can't use that method for stuff inside the function?
I guess you would have to still use console.log for those, right?
@Manish-Giri Thanks
CamperBot
@camperbot
Oct 11 2017 23:57
burinson sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 6644 | @manish-giri |http://www.freecodecamp.com/manish-giri
korzo
@korzo
Oct 11 2017 23:59
Yes, you can't change/access variables in local scope... unless you add breakpoint to code