These are chat archives for FreeCodeCamp/Help

25th
Aug 2017
shumindong
@shumindong
Aug 25 2017 01:27
<form action="/submit-cat-photo">
<lable> <input type="radio" name="indoor-outdoor" > indoor</lable>
<lable> <input type="radio" name="indoor-outdoor" > outdoor</lable>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
HOW TO Create a Set of Radio Buttons
Gersho
@Gersho
Aug 25 2017 01:29
lable ?
shumindong
@shumindong
Aug 25 2017 01:29
WHAT I writen cannot succeeded
yes
add two radios
Gersho
@Gersho
Aug 25 2017 01:31
so what's a lable ? do you mean a label ?
Ginger
@GingerChew
Aug 25 2017 01:32
Hey all, I'm having some trouble with this campfire about javascript closures, I'm not sure how to invoke the closure
function addTogether() {
  var arg = [].slice.call(arguments), argSum = arg[0];
  function sumTwoAnd(arg) {
    if (typeof arg[0]  == 'number') {
      arg += arguments[1];
    } else if (typeof arg[0] == 'number' && arg.length <2){
      return undefined;
    }
    return arg0;
  } 
  sumTwoAnd;
}
Gersho
@Gersho
Aug 25 2017 01:33
shouldn't it be sumTwoAnd(); at the end ?
Ginger
@GingerChew
Aug 25 2017 01:33
the example calls for addTogether(2)(3); and I can only get it to use the 2 from the arguments object not the three
Gersho
@Gersho
Aug 25 2017 01:33
and arg[0] instead of arg0 ?
oh, you're looking for the arguments objects
Ginger
@GingerChew
Aug 25 2017 01:34
function addTogether() {
  var arg = [].slice.call(arguments), argSum = arg[0];
  function sumTwoAnd(arg) {
    if (typeof arg[0]  == 'number') {
      argSum += arguments[1];
    } else if (typeof arg[0] == 'number' && arg.length <2){
      return undefined;
    }
    return argSum;
  } 

}
sumTwoAnd;

addTogether(2,3);
if I call sumTwoAnd at the end, it's out of scope
shumindong
@shumindong
Aug 25 2017 01:34
i mean that it needs add two radio buttons for the form
Ginger
@GingerChew
Aug 25 2017 01:34
so it needs to be in the brackets of function addTogether();
Gersho
@Gersho
Aug 25 2017 01:35
no i mean
you typed sumTwoAnd , but shouldn't it be sumTwoAnd() ?
it needs () to be called no ?
Ginger
@GingerChew
Aug 25 2017 01:36
yeah, you're right there
but now I've got another issue
Gersho
@Gersho
Aug 25 2017 01:37
@GingerChew let's hear it
Ginger
@GingerChew
Aug 25 2017 01:38
It was just a reference issue, but now here comes the big one, with the function as it is now
function addTogether() {
  var arg = [].slice.call(arguments), argSum = arg[0];
  function sumTwoAnd(arg) {
    if (typeof arg  == 'number') {
      argSum += arguments;
    } else if (typeof arg == 'number' && arg.length <2){
      return undefined;
    }
    return argSum;
  } 
  sumTwoAnd();
}
it returns an error saying that addTogether isn't a function
Gersho
@Gersho
Aug 25 2017 01:41
that's weird
Ginger
@GingerChew
Aug 25 2017 01:42
right?
Cause basically if it is given one argument it should return a function that will then process a second argument.
hence sumTwoAnd
Gersho
@Gersho
Aug 25 2017 01:44
might be a typo somewhere i didn't get that error
Ginger
@GingerChew
Aug 25 2017 01:45
I'm trying not to cheat with the get ahint thing but I'm really super stumped
Ginger
@GingerChew
Aug 25 2017 02:00
I caved
I was so far off it's not even funny
but I get it now
Gersho
@Gersho
Aug 25 2017 02:01
as long as you understand it
Ginger
@GingerChew
Aug 25 2017 02:02
yeah, it was the first solution that needed 10+ lines of code, I got hung up on needing to do it in as little code as possible
also, the closure example given confused me, but it makes sense now
Gersho
@Gersho
Aug 25 2017 02:03
you're not being paid on the amount of line (or low amount in your case)
as long as it works and doesn't hog 16GB of ram doing it ^^
Ginger
@GingerChew
Aug 25 2017 02:04
hahaha, true!
Gersho
@Gersho
Aug 25 2017 02:05
fun fact: back when bill gates was working for IBM, they wanted to pay him based on the number of lines, he told them it was stupid
Long Nguyen
@longnt80
Aug 25 2017 02:11

@Gersho

fun fact: back when bill gates was working for IBM, they wanted to pay him based on the number of lines, he told them it was stupid

more lines or less lines for more money?

Gersho
@Gersho
Aug 25 2017 02:12
more lines more money, they were discussing the pricing on the software base on the number of thousand of lines of code (kiloLines)
Long Nguyen
@longnt80
Aug 25 2017 02:13
it's the same with paying for the amount of time, I guess
more skilled person will do the same thing with less time
Gersho
@Gersho
Aug 25 2017 02:15
also it was back in the era when IBM was boss of the industry
Long Nguyen
@longnt80
Aug 25 2017 02:16
that mentality still exists today
if you can do this in 5 minutes, why do you charge so much for it
Gersho
@Gersho
Aug 25 2017 02:18
these days i'm more worried about the bloatware mentality, putting heavy animations everything
took me 10 years to do it in 5 mins
Ginger
@GingerChew
Aug 25 2017 02:18
How do you use a regEx to filter out items of an array? I thought it was .map() but that's not seeming to do anything for me
function telephoneCheck(str) {
  // Good luck!
  var hello = str.split(''), reg = /[^0-9]/g;
  var remove = hello.map(function(index) {
    if (index != reg) {
      return index;
    }
  });
  return remove;
}
Long Nguyen
@longnt80
Aug 25 2017 02:19
@GingerChew you need to use match()
Ginger
@GingerChew
Aug 25 2017 02:20
ahhhhh
gotcha
@longnt80 thanks!
CamperBot
@camperbot
Aug 25 2017 02:20
gingerchew sends brownie points to @longnt80 :sparkles: :thumbsup: :sparkles:
:cookie: 529 | @longnt80 |http://www.freecodecamp.com/longnt80
Randell Dawson
@RandellDawson
Aug 25 2017 04:04
@GingerChew Is the goal of the function telephoneCheck to return the non-numeric characters in str or return str with non-numeric characters removed?
Owais Ahmed
@owaisehmed
Aug 25 2017 07:30
Need help
after clicking on the page links
The css changes
I want it to remain the same
as it is before getting clicked
Gulsvi
@gulsvi
Aug 25 2017 07:44
Since you're posting in all the rooms :p @owaisehmed :point_up: This answer in the HelpJavaScript Room should help
Lord Detex
@sammyoung007
Aug 25 2017 08:59
Hey Long time everyone :wave:
Suhail Bahawi
@IKing4ever1
Aug 25 2017 10:26
hello everyone
i've a problem in php
when i add this code
                        <br><form action="" method="post"><button type="button" name="del-button" class="btn btn-danger">Delete All</button>
                                <?php

                                    if (isset($_POST['del-button'])) {

                                        $sql-del = "Delete * from `Suggestions`";
                                        mysqli_query($connect, $sql-del);
                                    }


                                    mysqli_close($connect);

                                ?>
                            </form>
to this code

````
<?php

    if (@!$_SERVER['HTTP_REFERER']) {
        die('<p style="color: red; font-size: 20px;">You must Entry this page by another page !</p>');
    }
    if (@$_SERVER['HTTP_REFERER'] == "cp-sug.php.php") {
        die('<p style="color: red; font-size: 20px;">You must Entry this page by another page !</p>');
    }

?>
<?php

$servername = "sql213.byethost10.com";
$username = "b10_20563600";
$password = "Flux12345";
$dbname = "b10_20563600_Suggestions";

$connect = new mysqli($servername, $username, $password, $dbname);

// mysql connect check

if ($connect->connect_error) {
die("Connection failed: " . $connect->connect_error);
}

?>
<!DOCTYPE html>

<html>
<head>
<!-- Font awesome -->
<script src="https://use.fontawesome.com/96807cfa02.js"></script>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <title>cp - suggestions</title>
    <link rel="icon" href="http://hative.com/wp-content/uploads/2013/05/letter-f-logo-design-finishing-touch.png">


    <!-- Style -->
    <link type="text/css" rel="stylesheet" href="style.css">


    <!-- BootStrap Style -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">


    <!-- Bootstrap Script -->
    <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>

</head>
<body>
    <div>

        <center><div>
            <h1 id="cp-sug-header">the Suggestions:</h1>
            <div class="well well-lg cp-sug">
                <div class="cp-sug-table">
                    <table class="table table-striped">

                        <thead>
                            <tr>
                                <th>Rating</th>
                                <th>Positives</th>
                                <th>Negatives</th>
                                <th>Suggestions</th>
                            </tr>
                        </thead>
                        <tbody>
                        <?php 

                        $sql = "select * from `Suggestions`";
                        $result = $connect->query($sql);


                        if ($result->num_rows > 0) {

                            while($row = $result->fetch_assoc()) {

                                echo "<tr>";
                                    echo "<td>".$row['rating']."</td>";
                                    echo "<td>".$row['Positives']."</td>";
                                    echo "<td>".$row['Negatives']."</td>";
                                    echo "<td>".$row['Suggestions']."</td>";
                                echo "</tr>";

                            }
                        }


                        ?>
                        </tbody>
                    </table>

                </div>
            </div>
        </div></center>

    </div>
            <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="https://code.jquery.com
the page don't run
why ?
the problem in my code or in the host ?
  • i use a freehost
Bryan Reese
@breese8009
Aug 25 2017 10:42
@IKing4ever1 its always best to post in codepen, reading that code like that isnt fun
Jayendra Prashanth
@jay27111995
Aug 25 2017 11:05
hey guys
I have a problem with a small c code for prime number, can anyone help?
Stephen James
@sjames1958gm
Aug 25 2017 11:05
@jay27111995 Sure
Jayendra Prashanth
@jay27111995
Aug 25 2017 11:05
alright, I'll post the link of the code
1 minute
heroiczero
@heroiczero
Aug 25 2017 11:07
@jay27111995 post your code with ''' :point_down:
CamperBot
@camperbot
Aug 25 2017 11:07
:bulb: to format code use backticks! ``` more info
in this 'program to find first n prime numbers'
Suhail Bahawi
@IKing4ever1
Aug 25 2017 11:12
@breese8009 but i can't do php code in codepen...
ot ?
or ? *
Stephen James
@sjames1958gm
Aug 25 2017 11:13
@jay27111995 You are doing only the first 10?
Jayendra Prashanth
@jay27111995
Aug 25 2017 11:13
No it would be entered by the user, but 10 for now
@sjames1958gm
Stephen James
@sjames1958gm
Aug 25 2017 11:15
@jay27111995 And what is the problem you are seeing?
Jayendra Prashanth
@jay27111995
Aug 25 2017 11:15
no output at all.
@sjames1958gm
Stephen James
@sjames1958gm
Aug 25 2017 11:18
@jay27111995 one thing is you should probably reset your flag variable before entering the for loop
Stephen James
@sjames1958gm
Aug 25 2017 11:37
@jay27111995 did you disappear?
Amit Patel
@AmitP88
Aug 25 2017 11:38
hey guys, I'm doing the Markdown Previewer project on FCC and I was wondering, since we have to have an input box and an output box, should I use two root divs in my html instead of one? (like one root div with id="input" and one with id="output)
heroiczero
@heroiczero
Aug 25 2017 11:39
you could or you could do one div and the rest with React
Suhail Bahawi
@IKing4ever1
Aug 25 2017 12:33
are there any wrong in this code ???
                        <br><form action="" method="post"><button type="button" name="del-button" class="btn btn-danger">Delete All</button>
                                <?php

                                    if (isset($_POST['del-button'])) {

                                        $sql-del = "Delete * from `Suggestions`";
                                        mysqli_query($connect, $sql-del);
                                    }


                                    mysqli_close($connect);

                                ?>
                            </form>
Christopher Zevallos
@ChristopherZev
Aug 25 2017 13:08
Hello Everyone! Does anyone know how the certificates are working in the Beta Program? Considering there is no saved progress
that link may not currently work because the forum is having some issues methinks
Kyle Holm
@thekholm80
Aug 25 2017 14:20
@dhcodes 2 projects left in data viz?
Josebuendia
@Josebuendia
Aug 25 2017 14:29

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

orange-text {

color: orange;

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

<h1 id="orange-text" class="pink-text blue-text">Hello World!</h1>

<h1 style= "color: white">
</h1>
Your H1 element should be white is the last bit of the challenge but isn't that the 2 line?

Stephen James
@sjames1958gm
Aug 25 2017 14:52
@Josebuendia It didn't say create another h1
@Josebuendia <h1 style="color: green"> this was just a sample - you were supposed to modify the existing h1
Darren
@DarrenfJ
Aug 25 2017 14:57
morning fCC
how goes the battle
wrestling the code to the ground
Stephen James
@sjames1958gm
Aug 25 2017 14:58
@DarrenfJ The ground appears to be quicksand
Darren
@DarrenfJ
Aug 25 2017 14:58
i hear yah ;)
@thekholm80 hey man :D
Dylan
@dhcodes
Aug 25 2017 15:34
@thekholm80 one and I'm mostly there; life is getting in the way
渡边飞
@ainiebao
Aug 25 2017 15:43
blob
i can't edit the line code
please do me a favor
favour
Darren
@DarrenfJ
Aug 25 2017 15:51
@ainiebao sometimes I find with the exercises that they need a reset...
the cursor ends up at weird lines and won't let you type.. i just hit reset on the exercise and it reloads the whole thing
usually fixes it for me
渡边飞
@ainiebao
Aug 25 2017 15:52
@DarrenfJ good job.thanks
CamperBot
@camperbot
Aug 25 2017 15:52
:star2: 1987 | @darrenfj |http://www.freecodecamp.com/darrenfj
ainiebao sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
Darren
@DarrenfJ
Aug 25 2017 15:52
@ainiebao worked?
goodGood :D
渡边飞
@ainiebao
Aug 25 2017 15:53
bingo
@DarrenfJ
Darren
@DarrenfJ
Aug 25 2017 15:53
right on :D
it's a it of a nuisance but after doing a bunch in one sitting it just sometimes needs to be reset :)
渡边飞
@ainiebao
Aug 25 2017 15:56
English is my second language.if there are any grammar incorrection please correct me
柯摩
@ExcaliburEX
Aug 25 2017 16:02
No,i think your English is very good!
Compare to me
how to type these pictures like this :smile:?
Dylan
@dhcodes
Aug 25 2017 16:11
@ExcaliburEX you just did :D
you type a colon : and then a word to search for an emoji (picture)
ex :hamburger: :hamburger:
柯摩
@ExcaliburEX
Aug 25 2017 16:14
oh,i got it :+1: Thanks!
Kyle Holm
@thekholm80
Aug 25 2017 16:16
@DarrenfJ :wave:
@dhcodes sounds like it's not going to be a panic to finish old certs when beta rolls out
Dylan
@dhcodes
Aug 25 2017 16:17
where'd you hear that?
the old certs will still work
they just won't be the new certs
they will both live in ambiguous harmony
@thekholm80
Kyle Holm
@thekholm80
Aug 25 2017 16:19
that's what i was saying, people enrolled before a certain date will have the option of finishing the old certs
initially we all thought that we'd have to hurry to finish the old certs or lose out
Robert Marić
@Mariciano95
Aug 25 2017 16:35

Hello,maybe this is not the right place for this, but I am trying to replace the cube with the character in the png image commented out at the beginning. It's a little game I am trying to make in HTML.

Link to the code

Dhaval
@Dhavalc2012
Aug 25 2017 16:39
Hey @DarrenfJ @thekholm80 whats up guys
:smiling_imp:
Kyle Holm
@thekholm80
Aug 25 2017 16:42
@Dhavalc2012 :wave: hey long time no see
Dylan
@dhcodes
Aug 25 2017 16:42
oh.. i didn't see the "not"
Dhaval
@Dhavalc2012
Aug 25 2017 16:43
yeah i m back lol
switch to wpf for now
:laughing:
whats up kyle
Kyle Holm
@thekholm80
Aug 25 2017 16:43
wpf?
Dhaval
@Dhavalc2012
Aug 25 2017 16:43
windows presentation foundatiton
its for windows desktop
Kyle Holm
@thekholm80
Aug 25 2017 16:43
oh, neat
Dhaval
@Dhavalc2012
Aug 25 2017 16:44
yeah :satisfied:
n trying to do node stuff too
especially babel
Kyle Holm
@thekholm80
Aug 25 2017 16:46
babel is awesome
configuring it in node was a challenge though
Dhaval
@Dhavalc2012
Aug 25 2017 16:47
yeah setting presset n all .
i like the way it converts es2014 to old one
n modules are awesome
Kitten n manish still around ?
aRtoo
@artoodeeto
Aug 25 2017 17:01
whats good fam! just wanted to ask. is this called cheating?? on my algo problem it wasnt stated that i should use parseIntbut i did. to conver the binary to charCode. and you have another solution for this algo?? heres the code:

function binaryAgent(str) {

  str = str.split(' ');
  var binVal = [];
   var parseVal; 

  for(var i=0; i<str.length; i++) {
    parseVal = parseInt(str[i],2);

    binVal.push(String.fromCharCode(parseVal));
  }

  return binVal.join('');

}
Suhail Bahawi
@IKing4ever1
Aug 25 2017 17:01
anyone know php help group ?
Dylan
@dhcodes
Aug 25 2017 17:02
did it say not to use parseInt @artoodeeto ?
@IKing4ever1 better off asking in the main room
aRtoo
@artoodeeto
Aug 25 2017 17:03
@dhcodes no. i just thought since it didnt say we can use it too. lol
Dhaval
@Dhavalc2012
Aug 25 2017 17:03
yeah i know a bit @IKing4ever1
lol u can definitely use parseInt
shouldnt matter
Dylan
@dhcodes
Aug 25 2017 17:04
@artoodeeto yeah
Dhaval
@Dhavalc2012
Aug 25 2017 17:04
as long as u get solution
Dylan
@dhcodes
Aug 25 2017 17:04
if it doesn't say not to, use whatever you'd like
Kyle Holm
@thekholm80
Aug 25 2017 17:12
@Dhavalc2012 diomed and manish are still around from time to time, not as much as they used to
Darren
@DarrenfJ
Aug 25 2017 17:17
@Dhavalc2012 hye buddy, yah long time no see :D
Dhaval
@Dhavalc2012
Aug 25 2017 17:18
yeah was busy learning new things lol
nice to see u guys here always
:D
Darren
@DarrenfJ
Aug 25 2017 17:18

@thekholm80 this is something I'm super excited about.. will mean i get cracking on certs again :D

@dhcodes sounds like it's not going to be a panic to finish old certs when beta rolls out

Dhaval
@Dhavalc2012
Aug 25 2017 17:18
free certs ?
Kyle Holm
@thekholm80
Aug 25 2017 17:18
mine were free
you have to pay for yours
i'll send you my paypal info
Darren
@DarrenfJ
Aug 25 2017 17:19
free except for the blood sweat and tears
Kyle Holm
@thekholm80
Aug 25 2017 17:19
and so much profanity
Dhaval
@Dhavalc2012
Aug 25 2017 17:19
lol :laughing:
edx certs are free arent they
Kyle Holm
@thekholm80
Aug 25 2017 17:20
my preferred programming languages:
  1. Profanity
  2. JavaScript
Dhaval
@Dhavalc2012
Aug 25 2017 17:21
lol i dont think profanity is gonna be so useful
javascript might be :P
Kyle Holm
@thekholm80
Aug 25 2017 17:21
it makes me feel better
Dhaval
@Dhavalc2012
Aug 25 2017 17:22
haha i guess then worth it
watch game of thrones to learn more abt it
:laughing:
an actual language
Kyle Holm
@thekholm80
Aug 25 2017 17:24
i don't think i'm smart enough for that lol
Darren
@DarrenfJ
Aug 25 2017 17:24
back in thee ole days we used to code only with special characters.. and walk uphill to school both ways.. in 10 feet of snow!
Kyle Holm
@thekholm80
Aug 25 2017 17:24
meanwhile, javascript compilers will soon allow you to use emojis as variable names
Dhaval
@Dhavalc2012
Aug 25 2017 17:36
wow
emojis as variable
i wonder what poop will be initalized too
:laughing:
Darren
@DarrenfJ
Aug 25 2017 17:48
@thekholm80 the future is now ;)
Kyle Holm
@thekholm80
Aug 25 2017 17:49
lol
Stephen James
@sjames1958gm
Aug 25 2017 18:06
@thekholm80 The nice thing about Profanity is the syntax is much more flexible :)
Kyle Holm
@thekholm80
Aug 25 2017 18:15
@sjames1958gm lol right you are
Chris
@bestintown23
Aug 25 2017 18:18
Hello how can i center my table? https://codepen.io/bestintown23/pen/zdpXjB
artbohr
@artbohr
Aug 25 2017 18:19
.
This is a React component method "ajaxReq" how can I pass and assign a state as an argument 'type' instead of 'recent'
example: type:data instead of recent:data
so I can change the state I'm passing depending on what state I want to change
ajaxReq (url, type)  { 
    const request = new XMLHttpRequest();
    request.open(
      "GET",
      url
    );
    request.send();

    request.onload = () => {
      if (request.status >= 200 && request.status < 400) {
        var data = JSON.parse(request.responseText);

        this.setState({
          recent: data });
      }
    };
  }
Stephen James
@sjames1958gm
Aug 25 2017 18:22
@bestintown23 Add this to the style for the div around the table
  display:flex;
  justify-content:center;
@artbohr Where are you calling this from?
@artbohr Oh, I see your question. You can do
let newState = {}
newState[type] = data;
this.setState(newState);
artbohr
@artbohr
Aug 25 2017 18:43
@sjames1958gm this would be the call
componentDidMount() {
    this.ajaxReq('https://fcctop100.herokuapp.com/api/fccusers/top/recent',recent);

  }
@sjames1958gm but I got a bit confused on how to distribuite ur answer in to the functions, thanks
CamperBot
@camperbot
Aug 25 2017 18:43
artbohr sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8385 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
artbohr
@artbohr
Aug 25 2017 18:44
@sjames1958gm define it on top then pass the data in the onload and then set in the end?
Stephen James
@sjames1958gm
Aug 25 2017 18:45
@artbohr pass "recent" into the function and replace your setState with those 3 lines.
Although, there is, I believe, a new syntax for variables as property names.
Try this - assuming that type is passed into the function as string "recent"
        this.setState({
          [type]: data });
just1witness
@just1witness
Aug 25 2017 18:48

@just1witness
I know this is nonsense, I am just playing around and learning a lot by seeing what different things do. Can anyone tell me why this for loop only runs once?

 var answer = ["TWENTY,","20","TWENTY,","20","TWENTY,","20","TWENTY,","20","TEN,","10","FIVE,","5","ONE,","1","QUARTER,","0.25","QUARTER,","0.25","DIME,","0.10","DIME,","0.10","PENNY,","0.01","PENNY,","0.01","PENNY,","0.01","PENNY,","0.01",]


 for(var i = 0; answer.length; i++){
   if(answer[i] === answer[i+2]){
     var sum =  +answer[i +1] + +answer[i + 3];
    return answer[i]  + sum;
   }
 }
     return answer;

It returns TWENTY, 40
I', trying to add the sum of the duplicates, btw

Stephen James
@sjames1958gm
Aug 25 2017 18:48
hmm maybe not? :(
just1witness
@just1witness
Aug 25 2017 18:48
umm, nvm, I'm a dummy, lol
Stephen James
@sjames1958gm
Aug 25 2017 18:48
@just1witness return exits the function immediately - no more code
just1witness
@just1witness
Aug 25 2017 18:49
ok, I see also that I forgot to add i < in the loop..
Stephen James
@sjames1958gm
Aug 25 2017 18:49
@just1witness That too :)
just1witness
@just1witness
Aug 25 2017 18:49
@sjames1958gm Thank you much!
CamperBot
@camperbot
Aug 25 2017 18:49
just1witness sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8386 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Aug 25 2017 18:50
@artbohr
var T = "recent";
var newS = { [type]: "test string"};

newS:
{recent: "test string"}
@just1witness :+1:
Gersho
@Gersho
Aug 25 2017 19:07
:wave: oh i see you've made progress on your code @just1witness
Yuserah Din
@YuserahN
Aug 25 2017 19:48
Can someone explain to me what parseInt() does exactly?
Christopher McCormack
@cmccormack
Aug 25 2017 19:49
parses a string into an integer
Gersho
@Gersho
Aug 25 2017 19:49
it converts a string to the equivalent integer
Christopher McCormack
@cmccormack
Aug 25 2017 19:49
the second argument determines the base you're using, by default it's base 10, but it's recommended you always specify
Gersho
@Gersho
Aug 25 2017 19:50
"3.14" (a string containing numbers) would become 3.14
Christopher McCormack
@cmccormack
Aug 25 2017 19:50
> parseInt('10')
10
> parseInt('10', 10)
10
> parseInt('10', 2)
2
Gersho
@Gersho
Aug 25 2017 19:51
there's also parseFloat that does the same for decimals
just1witness
@just1witness
Aug 25 2017 20:17
@Gersho Yes, I have correct output for all the tests. It's still in the wrong format though, not a two D array. I might start over and start with an object instead. I have learned SOOOO much with this challenge though, I'm very glad for it, as hard as it is. :)
Gersho
@Gersho
Aug 25 2017 20:35
well if you have the proper result but improper form, you should be able to convert it, but i concur starting over is good too (you might want to keep v1 saved somewhere)
@just1witness
just1witness
@just1witness
Aug 25 2017 20:47
@Gersho. Yeah, I have v1 on notepad++. I just feel like I did it all wrong, haha.
artbohr
@artbohr
Aug 25 2017 20:48
@sjames1958gm thanks
CamperBot
@camperbot
Aug 25 2017 20:48
artbohr sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8387 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Yuserah Din
@YuserahN
Aug 25 2017 21:04
@Gersho So if I'm given a set of binary digits inside a strong and I'm supposed to convert it to a readable sentence, I would need parseInt to first turn it into an int?
Gersho
@Gersho
Aug 25 2017 21:12
parseInt("1111", 2); // returns 15, if that's what you're asking @YuserahN
Justin25
@Justin25
Aug 25 2017 21:17
Does anyone here have experience with EJS (embedded javascript)?
aRtoo
@artoodeeto
Aug 25 2017 22:35
yow fam. how can i return one single value? so on the everything be true algo challenge i need to loop thru the collection and check the keys if it has a true value. if not return false. but its returning me multiple bool. heres the code fam. thanks

function truthCheck(collection, pre) {

return  collection.map(function(collection){

      if(collection[pre]){
        return true;
      }else {
        return false;
      }    
  });

}
Josebuendia
@Josebuendia
Aug 25 2017 22:59

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

orange-text {

color: orange;

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

<h1 id="orange-text" class="pink-text blue-text">
<h1 style= "color: white">Hello World!
</h1>

Margaret
@Margaret2
Aug 25 2017 22:59
@Josebuendia why did you make two <h1> tags?
Josebuendia
@Josebuendia
Aug 25 2017 22:59
What 's wrong with this? Says h1 should be white but it is white.
Margaret
@Margaret2
Aug 25 2017 23:00
the style attribute is supposed to be on the same h1 element
Justin25
@Justin25
Aug 25 2017 23:00
@artoodeeto You need to use a loop to check each element of collection
Margaret
@Margaret2
Aug 25 2017 23:01
@artoodeeto you can use the .every() method to check if every item in an array meets a condition
Josebuendia
@Josebuendia
Aug 25 2017 23:02
@Margaret2 thanks
CamperBot
@camperbot
Aug 25 2017 23:02
josebuendia sends brownie points to @margaret2 :sparkles: :thumbsup: :sparkles:
:star2: 2896 | @margaret2 |http://www.freecodecamp.com/margaret2
Margaret
@Margaret2
Aug 25 2017 23:03
sure :+1:
Stephen James
@sjames1958gm
Aug 25 2017 23:06
@Josebuendia You were supposed to update the h1 that was already there.
@artoodeeto reduce is for returning one value. You can use filter and then compare new length to old length. and .every of course
Mike Jones
@mikejones01
Aug 25 2017 23:45
.