These are chat archives for FreeCodeCamp/Help

14th
May 2019
Rafael Monroy
@rafaelmonroy
May 14 05:37
does anyone know why I can't see the result of code I write in the "your test code will go here section" ?
it just tells me if its right or wrong but doesnt show the result of the code I wrote
shahindu
@shahindu
May 14 10:18

Initialize the three variables a, b, and c with 5, 10, and "I am a" respectively so that they will not be undefined. ( // Initialize these three variables
var a;
var b;
var c;

// Do not change code below this line

a = 5 + 1;
b = 10 + 5;
c = c + "I am a String!";

Norvin Burrus
@ndburrus
May 14 10:41
shahindu
@shahindu
May 14 11:09

How to solve this is a understanding uninitialized variable. please anybody help me......................... Initialize the three variables a, b, and c with 5, 10, and "I am a" respectively so that they will not be undefined. (// Initialize these three variables
var a;
var b;
var c;

// Do not change code below this line

a = a + 1;
b = b + 5;
c = c + "String!";

Philip Durbin
@pdurbin
May 14 11:20
try var a = 1;
@shahindu
孤独时代的张张
@nicefafa
May 14 11:50

<style>
body {
background-color: black;
font-family: Monospace;
color: green;
}

.pink-text{
color:pink
}
</style>

<h1 class='pink-text'>Hello World!</h1>

i think it isright
May Kittens Devour Your Soul
@diomed
May 14 16:40
@nicefafa pink;
Jake
@JakeDVirus
May 14 17:54
is there any drawback of nesting one event inside another?
Brad
@bradtaniguchi
May 14 17:56
@JakeDVirus Not sure I know what you mean
Jake
@JakeDVirus
May 14 18:00
if i put scroll-event inside click-event (as shown below) then would it cause any problm or will it have any drawback
hamburgerElm.onclick = function() {
    window.addEventListener('scroll', somefunction());
}
Brad
@bradtaniguchi
May 14 18:03
So in this case your adding a listener "in a listener". Technically I don't think there are any as far long as the code you write doesn't get nested too deep (pyramid of doom)
The other thing that could crop up is memory leaks if you do this a lot, but not sure if that would affect this situation or not, but I personally wouldn't worry about it unless this code is in a loop or something haha. (yes memory leaks are bad, but I'd only care about them if you see them at this time)
Jake
@JakeDVirus
May 14 18:24
@bradtaniguchi Thanks a lot for solving some pieces of puzzle. Can you provide any link or some reference where i will find the information in details. i'd really appreciate that
alpox
@alpox
May 14 18:53
@JakeDVirus What you have to see is that whenever hamburgerElm is clicked, a new scrollhandler will be added. This means that if you click it twice (for example), the event handler for scroll will be called TWICE for ONE event
Jake
@JakeDVirus
May 14 18:57
@alpox and then i presume it is a bad thing and should be avoided if it has possiblities of being clicked much more like 100times or more. isn't it?
alpox
@alpox
May 14 19:14
Yes it should even be avoided if it can be clicked twice depending on what the event handler does
It could mess up the work of the handler
Brad
@bradtaniguchi
May 14 19:22
Oh yea, I totally missed that, sorry :(
Pavlo Rudyi
@paulcarroty
May 14 19:31
we should emit {..., connected: false} on disconnect event, don't you?
Jake
@JakeDVirus
May 14 19:50
@alpox Thanks mate
Rafael Monroy
@rafaelmonroy
May 14 20:04
does anyone know why I can't see the result of code I write in the in the console ?
just tells me if its right or wrong, but when its wrong it doesn't show the output code
for the basic javascript section
alpox
@alpox
May 14 20:22
@rafaelmonroy Depends on your code