These are chat archives for FreeCodeCamp/Help

Jan 2019
Christopher McCormack
Jan 24 00:00
@glitz20 you should really try to troubleshoot this on your own for a bit instead of asking for help at each step, the answers have been very similar - you're having issues with async function, if you need to brush up on them I recommend doing so
in this case you don't have a callback function for your second .then, you just threw the axios call into it
Jan 24 00:25
Hello all. Can any one offer a suggestion on how to click a button that will initiate a route to another page. I'm confused about where the function would exist. All of my routes are in my app.js file. An onclick function would be in another .js file. What is the best way to accomplish this task?
abraham anak agung
Jan 24 01:13
@nsonhouse what lib you used? I usually have my function on the button onclick, or using react router, just use Link component
Praveen Saraogi
Jan 24 06:52
anyone learning react we can learn together
Claudio Restifo
Jan 24 07:39
@raviloop there are both react veterans and novice as well here. I'm sure you'll find the support you need
Jan 24 09:43
 //This is a simple set of data relationships
    var links=[

       //Result after data grouping
       var result=[[0,1],[3,4,5],[6,7,8],[9,10,11]]
How to write a conversion method
Jan 24 10:23
@raviloop sure PM me lets see what we can do.
Claudio Restifo
Jan 24 10:33
@alexpande what's the logic for grouping?
Altin Rrahmani
Jan 24 10:38
function ViewPort(){
    var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
    var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
    var atan = Math.atan2(h / w);
    var angle = 90 - atan;
anyone knows why my alert of angle is NaN ?
May Kittens Devour Your Soul
Jan 24 10:41
Altin Rrahmani
Jan 24 10:41
broo @diomed is still alive
abraham anak agung
Jan 24 10:46
@DevKosov maybe Math.atan2(h, w) ?
Altin Rrahmani
Jan 24 10:47
@padunk muchas gracias ty
Jan 24 10:49
i am trying to learn js
const person = {
    name: 'Uma',
    age: 55,

    greet: () => {

        console.log('Hi, i am ' +;

when i run ,,
i get this
Hi, i am undefined
Jan 24 10:54
why it is undefined and does not show my name
abraham anak agung
Jan 24 10:55
@umasharma11 fat arrow function doesn't have its own this. so use function expression instead of arrow function
Jan 24 10:58
got it
Thanks @padunk
abraham anak agung
Jan 24 11:01
@umasharma11 :thumbsup:
Andrew Zamora
Jan 24 11:38
Sorry if I'm not asking this in the right way. Does anyone know how I can copy the value on this.state.timer instead of making a reference to it?
constructor(props) {
    this.state = {
      breakLength: 5,
      sessionLength: 20,
      interval: '',
      session: true,
      break: false,
      timer: 10
  countDown = () => {
    let timeLeft = this.state.timer
    this.setState(prevState => ({
      timer: prevState.timer - 1
Praveen Saraogi
Jan 24 11:53
@AndrewZamora where you want to copy
Andrew Zamora
Jan 24 11:57
let timeLeft = this.state.timer
@raviloop I'm trying to store the value of this.state.timer in a variable
@raviloop I think what I'm doing right now is just referencing it
Praveen Saraogi
Jan 24 12:11
@AndrewZamora i think there is no problem with that
value is getting copied to timeLeft
Andrew Zamora
Jan 24 12:12
oh ok cool
@raviloop thanks
Jan 24 22:00
print('Discounts on 4,10, and 15, at %20, %30, %40 off respectively')
#ask purchase amount in shirts

shirt=int(input('How many T-Shirts will you be purchasing today?'))
#define price

#define cost of shirts

#find discount
if   shirt >= 4:

elif shirt >= 10:

     shirt >= 15

print('Your discount is $',format(shirt,'.2f'),sep.'')
when I type 11 as the input, why do I get 20%?
I should get 30%
Jason Luboff
Jan 24 22:03
Becuase 11 is greeater than 4
Order of operations
The first expression to evaluate to true, is the one that is used
Jan 24 22:08