These are chat archives for FreeCodeCamp/Help

3rd
Mar 2018
Sam Goldberg
@sgoldber61
Mar 03 2018 01:04
@khaduch OK thanks Ken. You are right that doing a linear search seems like a bad idea. I'll try to fight mongoose and figure out how to do it!
CamperBot
@camperbot
Mar 03 2018 01:04
sgoldber61 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3767 | @khaduch |http://www.freecodecamp.org/khaduch
ZenManMike
@ZenManMike
Mar 03 2018 01:46

<!DOCTYPE html>

<html>
<body>

<h1>My First Heading<h1>
<p>My first paragraph<p>

</body>
</html>

I did something wrong with the code.
Can someone please help me out?
Adel
@AdelMahjoub
Mar 03 2018 01:48
@ZenManMike / is the secret
ZenManMike
@ZenManMike
Mar 03 2018 01:49
I thought you only need "/" at the end of the code.
Like at the end of body and html
Adel
@AdelMahjoub
Mar 03 2018 01:49
@ZenManMike <h1>My First Heading<h1> the / it needs
ZenManMike
@ZenManMike
Mar 03 2018 01:51
Oh, okay. Thank you AdelMahjoub. I appreciate it.
Manish Giri
@Manish-Giri
Mar 03 2018 01:52
@khaduch not too bad myself, trying to get some algo. practice in.
Adel
@AdelMahjoub
Mar 03 2018 01:52
@ZenManMike closing tags
NAVANEETH
@NAVANEETH1
Mar 03 2018 05:08
Should I use the programming languages taught in freecodecamp website or python for back end which is better
Fabien SHAN
@X140hu4
Mar 03 2018 05:33
@NAVANEETH1 Better for what?
NAVANEETH
@NAVANEETH1
Mar 03 2018 05:34
For back end
alpox
@alpox
Mar 03 2018 13:52
@NAVANEETH1 There is no better
Some prefer python, some prefer javascript.
Adegoke Fred
@Frediflexta
Mar 03 2018 14:10
Hi guys, i am getting this error TypeError: Cannot convert undefined or null to object when i try to delete an item in an object. i declared the obj. in a function constructor, and i am trying to delete items added to it, buy using delete(this.items["this.itemName"]);
Stephen James
@sjames1958gm
Mar 03 2018 14:12
@Frediflexta if this.itemName is a variable it shouldn't be in quotes
Adegoke Fred
@Frediflexta
Mar 03 2018 14:14
Its not a variable, its an argument, okay the function constructor is function Cart() { // set total attribute to 0 this.total = 0; this.items = {}; }
function Cart() {
  // set total attribute to 0
  this.total = 0;
  this.items = {};
}
Stephen James
@sjames1958gm
Mar 03 2018 14:15
@Frediflexta you have an object with the property "this.itemName" or is it only "itemName"
Adegoke Fred
@Frediflexta
Mar 03 2018 14:16
Cart.prototype.removeItem = function(itemName,itemQuantity,itemPrice) {
  delete(this.items["this.itemName"]);
Stephen James
@sjames1958gm
Mar 03 2018 14:16
a argument is no different than a variable, so you should just have [itemName]
Adegoke Fred
@Frediflexta
Mar 03 2018 14:17
Okay
Did that
                        ^

TypeError: Cannot convert undefined or null to object
Stephen James
@sjames1958gm
Mar 03 2018 14:18
just itemName not this.itemName
Sweet Coding :)
@SweetCodingInc
Mar 03 2018 14:19
Does this work?
delete(this.items[itemName]);
Adegoke Fred
@Frediflexta
Mar 03 2018 14:19
i did that too, still getting the same error
no it didn't
Still getting the same error
delete this.items[itemName];
                    ^

TypeError: Cannot convert undefined or null to object
Stephen James
@sjames1958gm
Mar 03 2018 14:21
@Frediflexta You might use console.log to see what is in this.items and itemName to make sure that the value is in the items object
Adegoke Fred
@Frediflexta
Mar 03 2018 14:26
Thanks Stephen, i didn't initialize the item object, it was empty when i decalred it in my cart, and so the values where undefined
using the console made me realise that
Thanks
Ken Haduch
@khaduch
Mar 03 2018 14:27
@Frediflexta - you have to make sure that this is pointing to something that you want it to point to. Sometimes you have to bind it
Adegoke Fred
@Frediflexta
Mar 03 2018 14:32
By bind it what do you mean please?
Ken Haduch
@khaduch
Mar 03 2018 15:01
@Frediflexta - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind - there is the MDN documentation. Not sure if you need it, but sometimes this doesn't get bound to a value (as in ES6 arrow functions) and I've seen some React stuff in lessons where you have to bind to get things working as they should be. Hard to tell from your code snippets what is going on.
Adegoke Fred
@Frediflexta
Mar 03 2018 15:07
Okay, thanks alot ken
Christopher McCormack
@cmccormack
Mar 03 2018 16:37
@Frediflexta how are you calling the removeItem function? I just tested this with similar code to yours and it worked fine
Darren
@DarrenfJ
Mar 03 2018 16:49
morning fCC
Ken Haduch
@khaduch
Mar 03 2018 16:55
@DarrenfJ - hey there, Darren - and everyone stopping by the room! How are things today? Happy Saturday!
Darren
@DarrenfJ
Mar 03 2018 16:55
hi man :D
how goes the weekend?
hey anyone know if the casual room got swallowed by the main room? I don;t see it on the picklist anymore
LydaTech
@lydatech
Mar 03 2018 17:12
@DarrenfJ its gone
Aditya
@ezioda004
Mar 03 2018 17:42
@Gersho Hey Gersho, I have a doubt in pset1 make mario. Do I have to make separate loop to print n number of hashes, cause I already have a loop
Kelechi Chinaka
@ke1echi
Mar 03 2018 17:45
you need a seperate loop to print n hashes @ezioda004
Aditya
@ezioda004
Mar 03 2018 17:46
@kelechy Damn, likewise for whitespaces too?
Kelechi Chinaka
@ke1echi
Mar 03 2018 17:49
:smile: yes
Aditya
@ezioda004
Mar 03 2018 17:50
I miss JS already :sob:
@kelechy Thanks for the help
CamperBot
@camperbot
Mar 03 2018 17:53
ezioda004 sends brownie points to @kelechy :sparkles: :thumbsup: :sparkles:
:cookie: 328 | @kelechy |http://www.freecodecamp.org/kelechy
Henry
@GitHub-Henry
Mar 03 2018 18:51
@DarrenfJ casual was removed, lack of use
BuntyBru
@BuntyBru
Mar 03 2018 19:17
I have a long list of data log in my command line
It is in the format of -2018-03-02T05:14:55+00:00.data.log
And there are a series of it
I have to find the latest date out of all
What command should i use?
Adegoke Fred
@Frediflexta
Mar 03 2018 21:51
@cmccormack i rectified it, i didn't declare the object i was trying to access in the function... fixed that, but now i have new bugs, lol. thanks for your concern
CamperBot
@camperbot
Mar 03 2018 21:51
frediflexta sends brownie points to @cmccormack :sparkles: :thumbsup: :sparkles:
:star2: 1362 | @cmccormack |http://www.freecodecamp.org/cmccormack