Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
  • Jun 19 2021 12:36
    @texas2010 banned @therichaverma
  • May 14 2020 22:39
    @bjorno43 banned @minitechtips_twitter
  • May 14 2020 22:38
    @bjorno43 banned @real-action
  • Feb 01 2020 00:27
    @bjorno43 banned @Ndoua
  • Jan 07 2020 03:11
    @bjorno43 banned @doctor-sam
  • Jun 20 2019 21:20
    @bjorno43 banned @shenerd140
  • May 10 2019 09:13
    @bjorno43 banned @zhaokunhaoa
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:15
    @bjorno43 banned @vnikifirov
Kris Baillargeon
Haha, yeah. It's 3 ticks to open and 3 ticks to close
If you do this ```javascript when you open it will highlight the syntax for us :)
So, what about the code confuses you?
Is it using a return or how you got to a?
how i got a
I get how it iterates through it but don't understand how it's pushing the value to it
Kris Baillargeon
What do you mean by pushing the value to it?
Pushing the value to a?
As in, how does the variable a end up equaling the result?
Yes exactly that
How does variable a end up equalling the result
Kris Baillargeon
Okay, hold on I'll break the code up for u so it's easier to understand
and hopefully I'll teach ya some ways to figure stuff like this out in the future :) Give me one second
No worries take your time
@krisb1220 any luck?
Kris Baillargeon
function smallestCommons(arr) {
  let max = Math.max(arr[0], arr[1]);
  let min = Math.min(arr[0], arr[1]);
  let range = [];

  for (let i = min; i <= max; i++){

  console.log(`range is ${range}`); 

  let a = range[0];

  console.log(`a starts as ${a}`)  

  for (let i = 1; i < range.length; i++){ 

    let b = range[i];  
    console.log(`In loop ${i} b=${b}`)

    let c = a;  

    while ( a && b){ 
      if (a > b){ 
        a %= b; 
        console.log(`In loop ${i} while loop, a is changed to ${a}`)

        b = b % a;
        console.log(`In loop ${i} while loop, b is changed to ${b}`)

    console.log(`a=${c} * ${range[i]} / ${a}+${b}`)
    a = c * range[i] / (a+b);

  return a
// this ^^^^^ confuses me big time!!!!!!!!!

Run that code. Let me know if it clears things up :)
If it doesn't let me know. I'll see if I can break it down further :)
Don't hesitate to let me know if you're still confused. It's honestly super confusing LOL
Kris Baillargeon
Tbh, I wouldn't worry if you don't get that
It's a bunch of complicated math shit you're really never gonna use LOL
Wow thanks I will give this a go first chance I get 2mrw 4am here time for bed!!!! LOL appreciate the help I will give you feedback tomorrow/ today aahhhh I'm fried LOL
Kris Baillargeon
I feel ya dude. Know your limits! I get to a point where I tell myself "you're useless".. Cause I am LOL
If you're tired, you're not thinking right. Shit becomes 1000x harder
I know right need sleep peace out dude 👍
@krisb1220 thank you sir
helped me understand this alot more
i would hope some day i understand JS like you do @krisb1220 :)
Kris Baillargeon
@aaqeebh1 You got this bro :)
Honestly, it was super confusing to me too
The best way to do it is to visualize what's happening through the loop
You'll notice that I just console.log() the different operations so you can see what's happening under the hood
Tbh, I've never had to do hardcore math like that. You'll probably have to do something like that eventually, but it's not often.
thanks for taking the time bro ;) i appreciate it alot
my maths was good once upon a time maybe this will bring it back out and it wont be as confusing anymore :)
Kris Baillargeon
@aaqeebh1 I was horrible at math in school
Failed it consistently
You don't really need hardcore math. When you do, you'll figure it out. Unless you have an actual serious learning disability related to math, you'll get it :) Even then, if you're persistent enough you'll still get it! It just takes time.
i will be persistent!!!!!!!!!!!!!!
Hi Everyone... am new here
How are you ?
Hi every body
how to use lodash in freecodecamp?
Idris Fagbemi
Chris Dalton

Good day campers. I am running into an error while building the quiz app in VueJS. Here is my error:

[Vue warn]: Property or method "answers" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

found in

---> <QuestionBox> at src/components/QuestionBox.vue
       <App> at src/App.vue

Here is my App.vue file:

  <div id="app">
    <b-container class="bv-example-row">
        <b-col sm="6" offset="3">



import Header from './components/Header.vue'
import QuestionBox from './components/QuestionBox.vue'

export default {
  name: 'App',
  components: {
  data() {
    return {
      questions: [],
      index: 0
  methods: {
  computed: {
    answers() {
      let answers = [...this.currentQuestion.incorrect_answers]
      return answers
  mounted: function(){


      method: 'get'
    .then((response) => {
      return response.json();
    .then((jsonData) => {
        this.questions = jsonData.results


#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;

...and here is my QuestionBox file:

    <div class="question-box-container">
            <template v-slot:lead>

            <hr class="my-4">

            <p v-for="(answer, index) in answers" :key="index">

                {{ answer }}

            <b-button variant="primary" href="#">Submit Button</b-button>
            <b-button @click="next" href="#">
                Next Question


export default {
    props: {
        currentQuestion: Object,
        next: Function

Aside from the error my issue is my answers are not showing on the UI even though I am passing {{answer}} into my paragraph tag. I have read through the page at https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties but it is a bit greek to me as this is my first go with VueJS. Can someone help? Please excuse any markdown errors. I will try to clean them up to make this more reader friendly.

Chris Dalton
I am having challenges getting an input from an html form to go into a recursion function. Can someone help me understand where I am going wrong? https://codepen.io/manwithgills/pen/gOrpGKE?editors=1111
Joseph Mawa
@Chris-Dalton It seems you have fixed the issue


let sampleWord = "astronaut";
let pwRegex = /^\D(?=\w{5})(?=\w*\d{2})/; // Change this line
let result = pwRegex.test(sampleWord);

how in the above code, the regex /^\D(?=\w{5})(?=\w*\d{2})/ is the correct answer according to the hint section? The challenge states that the characters have to be minimum 5 and can be more. But this regex sets the \w to exactly {5} ?