These are chat archives for FreeCodeCamp/HelpFrontEnd

25th
Oct 2018
Fabusuyi David Oluwasegun
@dav4thevid
Oct 25 2018 00:08
hi guys...kinda stuck with #Basic JavaScript: Use the Conditional (Ternary) Operator....the last one is not passing

here is my code
var code = "function checkEqual(a, b) {

  return a >= b ? true : false  

}

checkEqual(1, 2);"

Stevegolden12
@Stevegolden12
Oct 25 2018 06:28
@dav4thevid @dav4thevid You are really close. This function is supposed to check if two values are EQUAL or not. Hope that helps.
Nicolas Ramirez
@kamatheuska
Oct 25 2018 10:55
// this must throw a sintaxError
// var code = "function checkEqual(a, b) { 

// I would rather do:

function checkEqual (a, b) {
  return a >= b ? true : false  
}

checkEqual(1, 2);
@dav4thevid
Then try to see if your condition, in this case a >= b satisfies the requirements of your challenges. There you are asking: Is a greater than b?. Sounds that it doesn't checks equality...
Hussein Zaki
@Hussein90
Oct 25 2018 14:06
hi @all
BrianWilliams28
@BrianWilliams28
Oct 25 2018 14:29
can someone recommend a place that gives you practice using javascript with the DOM? I find FCC teaches you general javascript but doesn't touch much on tying it into the DOM...
Daniel
@dbsimeonov
Oct 25 2018 14:30
Just try to create a page without html, good practise for DOM and animations
BrianWilliams28
@BrianWilliams28
Oct 25 2018 14:30
i suppose that could work
Daniel
@dbsimeonov
Oct 25 2018 14:31
One of my interviews for a Junior position was exactly that. Creating a page only with JS and animations for changing positions
Nicolas Ramirez
@kamatheuska
Oct 25 2018 14:31
@Hussein90 did you manage to solve your issue?
greetings!
AJ Brommy
@AJ-Brommy
Oct 25 2018 14:33
@BrianWilliams28 nice profile photo :)
BrianWilliams28
@BrianWilliams28
Oct 25 2018 14:33
@AJ-Brommy thanks lol
Eric Weiss
@eweiss17
Oct 25 2018 14:35
@dbsimeonov sounds awesome, did you complete it?
Daniel
@dbsimeonov
Oct 25 2018 14:36
Yes but on the interview I was not impressed with their developers and took the offer from another company
Hussein Zaki
@Hussein90
Oct 25 2018 15:04
i have a little problem @all
Hussein Zaki
@Hussein90
Oct 25 2018 15:10
this is my little project todo list on table
it is working very good
but the little problem is the tasks under the personal category not starting from beginning like work category
Dany Din
@danydin
Oct 25 2018 15:56
hey
what's wrong here?
<script>
  document.addEventListener('DOMContentLoader', function(){
    document.getElementById('getMessage').onClick=function(){};
  });
</script>
Christopher McCormack
@cmccormack
Oct 25 2018 15:57
@danydin I believe it's onclick not onClick unless using React or another library that has it's own events
Dany Din
@danydin
Oct 25 2018 15:58
@cmccormack oh ya but still it says: // running tests
Your code should add an onclick event handler.
// tests completed
but i followed exactly as instructed
you want the link maybe to the challenge ? @cmccormack
Christopher McCormack
@cmccormack
Oct 25 2018 15:58
@danydin can you link the exercise?
:)
Christopher McCormack
@cmccormack
Oct 25 2018 15:58
thanks
@danydin did you change it to onclick? worked for me
Dany Din
@danydin
Oct 25 2018 16:00
ya still not working
<script>
  document.addEventListener('DOMContentLoader', function(){
    document.getElementById('getMessage').onclick=function(){};
  });
</script>
this? ^
@cmccormack
Aditya
@ezioda004
Oct 25 2018 16:03
@danydin Its DOMContentLoaded not DOMContentLoader
Christopher McCormack
@cmccormack
Oct 25 2018 16:04
@danydin that should have already been configured, did you change it?
Dany Din
@danydin
Oct 25 2018 16:04
ahh fcl this shit thanks you too @cmccormack @ezioda004
BrianWilliams28
@BrianWilliams28
Oct 25 2018 17:00
how can i set the content of my 3 list items here in pure JS?

let navEl = document.createElement("nav");
let brandEl = document.createElement("div");
let brandTag = document.createElement("a");
let navLinksEl = document.createElement("ul");
let liEls = document.createElement("li");
navLinksEl.className = "nav-links";
navLinksEl.appendChild(liEls);
navLinksEl.appendChild(liEls);
navLinksEl.appendChild(liEls);

brandTag.href="#";
brandEl.className = "brand";
let titleEl = document.createTextNode("Javascript Page");
document.body.appendChild(navEl).appendChild(brandEl).appendChild(brandTag).appendChild(titleEl);
navEl.appendChild(navLinksEl);
br3ntor
@br3ntor
Oct 25 2018 20:40
for (let i = 0; i < 3; i++) {
  let liEls = document.createElement("li");
  liEls.textContent = i;
  navLinksEl.appendChild(liEls);
}
Something like this maybe?
lwears
@lwears
Oct 25 2018 23:06
@AJ-Brommy Thanks for checking. Sorry for the delay in responding. It was just me having tired eyes / brain!