by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • May 14 22:38
    @bjorno43 banned @minitechtips_twitter
  • May 14 22:37
    @bjorno43 banned @real-action
  • Feb 01 00:26
    @bjorno43 banned @Ndoua
  • Jan 07 03:10
    @bjorno43 banned @doctor-sam
  • Aug 17 2019 09:33
    User @bjorno43 unbanned @linkin-park
  • Jun 20 2019 21:19
    @bjorno43 banned @shenerd140
  • May 10 2019 09:13
    @bjorno43 banned @zhaokunhaoa
  • Apr 27 2019 19:46
    @mstellaluna banned @zhonghuacx
  • Apr 25 2019 17:12
    @mstellaluna banned @cmal
  • Apr 01 2019 18:11
    thecodingaviator labeled #31179
  • Apr 01 2019 18:11
    thecodingaviator labeled #31179
  • Apr 01 2019 18:09
    thecodingaviator commented #31179
  • Apr 01 2019 18:09
    thecodingaviator labeled #31182
  • Apr 01 2019 18:09
    thecodingaviator labeled #31182
  • Apr 01 2019 18:07
    thecodingaviator commented #31182
  • Apr 01 2019 18:07
    thecodingaviator labeled #31190
  • Apr 01 2019 18:07
    thecodingaviator labeled #31190
  • Apr 01 2019 18:07
    thecodingaviator commented #31190
  • Apr 01 2019 18:05
    thecodingaviator commented #31157
  • Apr 01 2019 18:04

    thecodingaviator on master

    remove A (#31157) (compare)

lawrencia
@laurel67

hello please someone should help me with this code i have tried several times but still having error..var studlyCapVar;
var properCamelCase;
var titleCaseOver;

studlyCapVar = 10;
properCamelCase = "A String";
titleCaseOver = 9000;

lawrencia
@laurel67
please this is the question...studlyCapVar should be defined and have a value of 10.
properCamelCase should be defined and have a value of "A String".
titleCaseOver should be defined and have a value of 9000.
studlyCapVar should use camelCase in both declaration and assignment sections.
Passed
properCamelCase should use camelCase in both declaration and assignment sections.
titleCaseOver should use camelCase in both declaration and assignment sections.
Christopher McCormack
@cmccormack
@laurel67 I pasted your code into the problem and it worked, what browser are you using?
lawrencia
@laurel67
chrome
Christopher McCormack
@cmccormack
Also when pasting code or pasting output please use Markdown so it's easy to read:
image.png
can you post a screenshot that includes your code and the output after hitting submit?
lawrencia
@laurel67
okay i will
Christopher McCormack
@cmccormack
Are you on Windows 10?
If so you can use the keyboard shortcut Winkey + Shift + S to quickly take a screenshot of a selected area and store it in your clipboard, then you can simply paste it here
lawrencia
@laurel67
image.png
image.png
lawrencia
@laurel67
@cmccormack please i have sent
Christopher McCormack
@cmccormack
@laurel67 what you posted here is different than your code, check the capitalization of the first variable in your screenshot
notice your error tells you the variable is not defined, this can mean you misspelled it or used different casing
lawrencia
@laurel67
okay
yh
lunify
@lunify

Hello, could anyone please help with this ?

I've been stuck with defining a custom @@iterator for my object which accepts arguments. Everything works with a generator function, but using a regular one with .next() that returns iteration objects gives me a TypeError: obj[Symbol.iterator] is not a function or its return value is not iterable.
Here's my code. I would really appreciate the help:

const obj = {
  [Symbol.iterator]({ start = 0, end = 10, step = 1} = {}) {
    let counter = start - step;
    return {
        next() { 
            return (counter += step) <= end ? { value: counter } : { done: true }; 
        }
    }
  },
//   *[Symbol.iterator]({ start = 0, end = 10, step = 1} = {}) {
//     let counter = start - step;
//     while ((counter += step) <= end) {
//         yield counter;
//     }
//   },
};

// works fine with both versions
for (let value of obj) {
    console.log(value);
}

// only works with generator version
for (let value of obj[Symbol.iterator]({ start: 14, end: 50, step: 4 })) {
  console.log(value);
}
lunify
@lunify

Solution:

For anyone wondering why it wasn't working, here's the reason:

  • When calling obj[Symbol.iterator](), you get an Iterator as a result.
  • Defaults iterators are iterables, but custom ones are not.
  • builtin operators and constructs like for..of, destructuring or the spread operator operate on iterables
  • For a custom iterator to become an iterable, it needs to implement @@iterator as well. Its @@iterator needs return itself

So the fix is to add [Symbol.iterator]() { return this } along with next()

const obj = {
  [Symbol.iterator]({ start = 0, end = 10, step = 1} = {}) {
    let counter = start - step;
    return {
        next() { 
            return (counter += step) <= end ? { value: counter } : { done: true }; 
        },
        [Symbol.iterator]() {
            return this;
        }
    }
  },
};

// now works !
for (let value of obj[Symbol.iterator]({ start: 14, end: 50, step: 4 })) {
  console.log(value);
}
Joseph Gachau
@josephmgachau
Hi
Baha
@hijazi
Hi @josephmgachau
AndyWebster
@AndyWebster
Hi, I'm experiencing problems with the course: Quality Assurance and Testing with Chai. After I complete each exercise and hit the "I've completed this challenge" button the test results seem to be random i.e. if I wait and hit the button again I get different test results each time even if I do not change my code. Any ideas on how to resolve this?
Richard
@rylew0925
hi. Does anyone have a moment to help out with a particular code where I am stuck?
I cannot seem to figure out why the h2 elements do not center
image.png
Victor Popescu
@VicPopescu
@rylew0925 you have position: absolute on h2 tags. That's why
@rylew0925 remove the position: absolute or add width: 100% to work
and read a little about absolute positioning and make sure you understand what happens :D
Richard
@rylew0925
Thanks!
Linh Nguyen My
@pinglinh
Hi everyone, I am trying to pass the last test to Exercise tracker but it keeps failing...here is the link to my project https://glitch.com/edit/#!/exercise-tracker-pinglinh
the behaviour seems correct as the example project provided so I'm not sure what is going wrong here \
Linh Nguyen My
@pinglinh
looks like my test is timing out
Linh Nguyen My
@pinglinh
I have figured this out now and updated the forum post: https://www.freecodecamp.org/forum/t/exercise-tracker-project-tests-not-passing/402793
Jake
@JakeDVirus
Hey guys i'm in very very deep confusion and dwelling over a choice.
I'm planning to build a live streaming project like twitch.tv so it will be big project. Which will suit more out of React or Angular from the performance and effectiveness's perspective (not learning curve)?
It was known that for project with much dynamic content, react is suitable but as ivy is introduced in reacent update of Angular it seems it is not losing to speed in dynamic content.
I expect (and i will really appreciate) other experienced developers opinion who has good knowledge of both REact and angular
Brad
@bradtaniguchi
If your building a video streaming platform neither of those will do much for the main feature of the app which is video streaming. In terms of raw run-time performance Angular and React are basically the same as of late. I'd say its easier to shoot yourself in the foot with either if you don't build for the right requirements, but neither will matter much if your video performance is bad
@JakeDVirus
Jake
@JakeDVirus
@bradtaniguchi thanks bro. Thanks for bringing me some clarity
Gatwiri
@ValentineGatwi3_twitter
hey need help in this code the problem says that the a element should have a closing tag? <body>
<header>
<h1>Deep Thoughts with Master Camper Cat</h1>
</header>
<article>
<h2>Defeating your Foe: the Red Dot is Ours!</h2>
<p>Felines the world over have been waging war on the most persistent of foes. This red nemesis combines both cunning stealth and lightening speed. But chin up, fellow fighters, our time for victory may soon be near.Click here for <a href ="">information about batteries</a></p>
</article>
</body>
AndyWebster
@AndyWebster
@ValentineGatwi3_twitter The closing tag looks fine. Did you try putting a value in the href? Sometimes the error message is not exact. e.g. <a href ="#"></a>
Gatwiri
@ValentineGatwi3_twitter
@AndyWebster The question was to leave it blank .Anyway i solved the issue i had left the space between href and = sign .thanks for the response
FirdavsiA
@FirdavsiA
Is there a reset button on FCC ? Why don't they make one ?
Christopher McCormack
@cmccormack
@FirdavsiA do you mean per-exercise or for all cirriculum?
Both exist - you can reset an exercise using the Reset All Code button on the left panel, and you can reset everything from your settings:
image.png
Richard
@rylew0925
Hi everyone, I'm trying to apply this wrapper class method:
@media only screen and (min-width: 600px) { .wrapper { grid-template-columns: 50% 50%; grid-template-areas: "sidebar sidebar2" } }
How do I apply the @media responsive style so that the second boxes goes underneath the first boxes when I shrink down the page's width? I keep getting weird layouts so I know I'm very close
Ross Chapman
@rosschapman

Hi folks. I've been working through the basic responsive web course with a mentee and I noticed that the parser that eval's the code does not error on the following invalid HTML:

<a href="#" "foo" target="_blank">

Should I open an issue?

Christopher McCormack
@cmccormack
@rosschapman probably not worth it, the test is most likely a simple regex just looking for what should be there, not what should not. I'm not even certain that would error within the spec, as attributed can be written without a value. https://html.spec.whatwg.org/dev/syntax.html#attributes-2