These are chat archives for FreeCodeCamp/Help

18th
Mar 2018
Darren
@DarrenfJ
Mar 18 2018 01:32
evening fCC...
hope the coding is going well :D
Kyle Holm
@thekholm80
Mar 18 2018 01:37
@DarrenfJ :wave:
Darren
@DarrenfJ
Mar 18 2018 01:42
@thekholm80 hey buddy!
Kyle Holm
@thekholm80
Mar 18 2018 01:43
@DarrenfJ did you make it through your pod casts?
Adegoke Fred
@Frediflexta
Mar 18 2018 04:49
@sjames1958gm Its still not working on my end, i think it has to do with how i'm trying to manipulate the DOM, i'm most likely going about it the wrong way
Adegoke Fred
@Frediflexta
Mar 18 2018 06:06
Hi guys, please i need help
i am having trouble working with my DOM, i wrote a function that checks for palindrome and it works perfectly,but my challenge is patching it with my html code
Nazar
@IsaakNazar
Mar 18 2018 06:23
show your code
Adegoke Fred
@Frediflexta
Mar 18 2018 06:59
I think it will be easier if i share my codepen link @IsaakNazar
This is the spec of what i am trying to build
Create a simple web app that identifies palindromes. At a minimum, it should take in a word/phrase from the user via a textbox, determine whether or not it is a palindrome, and display the result. It should also keep a record of the last 5 entries made by the user.
the 1st bug i'm encountering is the isPalindrome function sees the empty textarea as a palindrome
And i would like to mention that i checked for empty strings when writing my isPalindrome function
Sam Goldberg
@sgoldber61
Mar 18 2018 07:08
It shouldn't be " "
Fabien SHAN
@X140hu4
Mar 18 2018 07:09
@Frediflexta Delete the space
Sam Goldberg
@sgoldber61
Mar 18 2018 07:09
It should be "" with no space
Fabien SHAN
@X140hu4
Mar 18 2018 07:09
@Frediflexta " " is not empty, its a space :)
Adegoke Fred
@Frediflexta
Mar 18 2018 07:12
Hahahahaha!!! OMG! It works now
Are you for real?!
Honestly! i wouldn't have seen that
Sam Goldberg
@sgoldber61
Mar 18 2018 07:13
OK I have advice
Do you know about Javascript truthy and falsy?
The "" is falsy, whereas " " is truthy.
Adegoke Fred
@Frediflexta
Mar 18 2018 07:13
No
Ahhhh!! i see...
Sam Goldberg
@sgoldber61
Mar 18 2018 07:14
You could have just written if(str)
Try it! Try just writing if(str) and it shoudl still work
sorry i meant you could just write if(!str)
Adegoke Fred
@Frediflexta
Mar 18 2018 07:15
Yea, just did, it works, i actually wrote it like this earlier, but since it kept seeing my empty textarea as a palindrom, i decided to re-write it as is(str === true)
Thanks, i have corrected it and it still works
Sam Goldberg
@sgoldber61
Mar 18 2018 07:16
um.... that might not work. that's different.
Adegoke Fred
@Frediflexta
Mar 18 2018 07:16
Alright, so i have one more challenge
When i click last 5 enties i want it to open up a modal box, with at most the last 5 entries
How do i go about that please?
Sam Goldberg
@sgoldber61
Mar 18 2018 07:18
Wait I'm still worried about the palindrome thing. Does your palindrome thing still work for actual palindrome strings?
because if(str === true) won't work becuase of the triple equals which denys type coercion
you should just write if(str == true) with just double equals, or better yet, just if(str)
Adegoke Fred
@Frediflexta
Mar 18 2018 07:19
Okay, i already changed it to if(str)
Sam Goldberg
@sgoldber61
Mar 18 2018 07:20
ok that should do it. if(str === true) would not be the same thing because triple equals means exact equality
Adegoke Fred
@Frediflexta
Mar 18 2018 07:22
Yea, that's true
so how do i go about this When i clicklast 5 entiesi want it to open up a modal box, with at most the last 5 entries
?
Fabien SHAN
@X140hu4
Mar 18 2018 07:36
@Frediflexta Before getting the modal box, what do you need to do in order to get the entries?
Adegoke Fred
@Frediflexta
Mar 18 2018 07:38
i need to save entries from the textarea to it
Fabien SHAN
@X140hu4
Mar 18 2018 07:39
@Frediflexta Yes, so you could start with that first. Do you want to keep those who are not palindrome as well?
Adegoke Fred
@Frediflexta
Mar 18 2018 07:40
Yes...
Nazar
@IsaakNazar
Mar 18 2018 07:49
@Frediflexta there's also another way, just keep in mind :smile: if(!!str) it converts to true and if(!str) to false
Adegoke Fred
@Frediflexta
Mar 18 2018 07:52
Ahh!! i see, thanks @IsaakNazar
CamperBot
@camperbot
Mar 18 2018 07:52
frediflexta sends brownie points to @isaaknazar :sparkles: :thumbsup: :sparkles:
:cookie: 315 | @isaaknazar |http://www.freecodecamp.org/isaaknazar
ahmed-issa-mohd
@ahmed-issa-mohd
Mar 18 2018 10:27
How can I resize this signature_pad https://github.com/szimek/signature_pad
Johnny
@JohnnyBizzel
Mar 18 2018 10:59
@ahmed-issa-mohd Reduce the size of the browser window.
Adam
@GoingAllTheWayUp
Mar 18 2018 12:35
I lost the e-mail that I completed the Frontend with, I can not recall the password. I want to do Mean Stack but want access to my account, andy help out there?
Yossi Fisch
@yoizfefisch
Mar 18 2018 16:59
I don't understand what the below line of code does on this lesson:
const Vegetable = makeClass();
Aditya
@ezioda004
Mar 18 2018 17:07
@yoizfefisch Its pretty much storing the class Vegetable in the const Vegetable
Darren
@DarrenfJ
Mar 18 2018 17:07
@thekholm80 yesterday's podcasts were reply all today is 'things you should know' or something like that 'things you missed in history'
Yossi Fisch
@yoizfefisch
Mar 18 2018 17:07
@ezioda004 Why is this needed for passing the test?
Darren
@DarrenfJ
Mar 18 2018 17:07
got a new phone and wasting time on the apps too
Aditya
@ezioda004
Mar 18 2018 17:10
@yoizfefisch Its just how the challenge is made, you shouldnt focus on that part, if you simply do this, it'd work too. I guess its made that way so it checks for your code perhaps.
 class Vegetable {
    constructor(name){
      this.name = name;
    }
  }
const carrot = new Vegetable('carrot');
console.log(carrot.name); //carrot
Yossi Fisch
@yoizfefisch
Mar 18 2018 17:13

@ezioda004 Exactly. All these extra nesting of functions in the ES6 section is really confusing me as a newbie.
I had a hard time figuring out what the code in this lesson was doing until I figured that this:

const half = (function() {
  "use strict"; // do not change this line

  // change code below this line
  return function half({max, min}) {
    // use function argument destructuring
    return (stats.max + stats.min) / 2.0;
  };
  // change code above this line

})();

is the same as this:

const half = (max, min) => {
  "use strict";
   return (stats.max + stats.min) / 2.0;
  };
Aditya
@ezioda004
Mar 18 2018 17:21

@yoizfefisch Those 2 are not same, well in first you're destructing and storing the values in max and min variables, they arent same as stats.max and stats.min.

const half = (function() {
  "use strict"; // do not change this line

  // change code below this line
  return function half({max, min}) {
    // use function argument destructuring
    return (max + min) / 2.0;
  };
  // change code above this line

})();

In your second code you're also just simply accessing the object and not destructing.

Kyle Holm
@thekholm80
Mar 18 2018 17:23
@DarrenfJ oh cool
what kind of phone?
Aditya
@ezioda004
Mar 18 2018 17:31
@yoizfefisch I may have been not so clear, so again in first block of code when you do {max, min}, this is destructing and you store the values of object's properties in these. In the latter block of code, (max, min) these are normal parameters but yes the same function named IIFE can be confusing for a newbie.