Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:33
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • May 10 09:13
    @bjorno43 banned @zhaokunhaoa
  • Apr 25 17:12
    @mstellaluna banned @cmal
  • Apr 01 18:11
    thecodingaviator labeled #31179
  • Apr 01 18:11
    thecodingaviator labeled #31179
  • Apr 01 18:09
    thecodingaviator commented #31179
  • Apr 01 18:09
    thecodingaviator labeled #31182
  • Apr 01 18:09
    thecodingaviator labeled #31182
  • Apr 01 18:07
    thecodingaviator commented #31182
  • Apr 01 18:07
    thecodingaviator labeled #31190
  • Apr 01 18:07
    thecodingaviator labeled #31190
  • Apr 01 18:07
    thecodingaviator commented #31190
  • Apr 01 18:05
    thecodingaviator commented #31157
  • Apr 01 18:04

    thecodingaviator on master

    remove A (#31157) (compare)

  • Apr 01 18:04
    thecodingaviator closed #31157
  • Apr 01 18:04
    thecodingaviator closed #33788
  • Apr 01 18:04
    thecodingaviator commented #33788
  • Apr 01 18:02
    thecodingaviator closed #31059
  • Apr 01 18:02
    thecodingaviator commented #31059
Stein-T Dale
@Lofthur
@cmccormack Got it to work. The thing was that i did not have the ingredients array in the other dishes. When the map function tried to go over those it returned with undefined :D
Tiago Correia
@tiagocorreiaalmeida
@piteto solved thanks
CamperBot
@camperbot
tiagocorreiaalmeida sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
api offline
Tiago Correia
@tiagocorreiaalmeida
no brownies for oyu
Christopher McCormack
@cmccormack
@Lofthur ahh consistency :D glad you found it
Andrew Knox
@iamknox
Screen Shot 2017-09-06 at 1.56.01 PM.png
Screen Shot 2017-09-06 at 1.57.08 PM.png
Can anyone tell me why the arrow function will leave 0 (zero the number) in the arrow but the second function takes 0 (zero) out of the array?
leave zero in the array**
Diego Mayer
@Chrono79
@iamknox
"0" == 0 //true
"0" === 0 //false
Randell Dawson
@RandellDawson
@iamknox - Because filter expects a boolean to be returned. When you return 0 in the non-arrow function version, that evaluates to false, so it is excluded.
Bryan Reese
@breese8009

Guys im trying to pull the data-styleid attribute value but having trouble...
here is the var an code im trying to get it with but gettin undefined.

let styleId = $(this).parents('.styleClass').data('styleid');

function renderStyles(style) {


    let styleHtml = `
    <!-- Style information -->

    <div class="card-header styleClass" data-styleid="${style._id}"><h1>${style.type} ${style._id}</h1></div>
        <div class="card-body">
            <p class="card-title">Description: ${style.description}</p>
            <p class="card-text">Comments: ${style.comments}</p>
            <p class="card-text"><a href="${style.link}">Wiki link</a></p>
            <div class="row">
                <div class="col-sm-2">
                    <button class="btn-danger delete-style">Delete</button>
                </div>
                <div class="col-sm-2">
                    <button class="btn-info">edit</button>
                </div>
            </div>
        </div>
        <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo">Add school</button>
    </div>

    `

    $('.styleDisplay').prepend(styleHtml);
}

```

so on click of a button, i want to console.log() the data-styleid attributes value
u would think $(this).data('styleid') would do the trick but it doesnt
piteto
@piteto
because it isn't an object @breese8009 it's a text string, so you have to use .attr()
let styleId = $(this).parents('.styleClass').attr('data-styleid');
Bryan Reese
@breese8009
@piteto still gettin undefined :(
piteto
@piteto
I think we need to see more code then to make sure this part is correct: $(this).parents('.styleClass')
Christopher McCormack
@cmccormack
@breese8009 is data-styleid="${style._id}" supposed to be a template literal? Those should use grave accents right? Or are you passing the string to use later?
Jason Luboff
@JLuboff
@cmccormack The entire thing is a template literal
so the quotes are okay
Christopher McCormack
@cmccormack
@JLuboff ah didn't see thanks
CamperBot
@camperbot
cmccormack sends brownie points to @jluboff :sparkles: :thumbsup: :sparkles:
api offline
Jason Luboff
@JLuboff
I had to go double check lol
Bryan Reese
@breese8009
@cmccormack yea its a full temp literal
Tiago Correia
@tiagocorreiaalmeida
need a little help guys
$( document ).ready(function() {
    var percentage = $(".progress").attr("progress");
    console.log(percentage);
});
got this
<span><a class="progress" progress="75"></a></span>
<span><a class="progress" progress="65"></a></span>
<span><a class="progress" progress="75"></a></span>
how can I loop all that spans
and get the value of every one of them 1 by 1?
the code I have only runs the first 1
Diego Mayer
@Chrono79
@tiagocorreiaalmeida try storing all the class progress anchors in an array and then use a loop
Tiago Correia
@tiagocorreiaalmeida
yeah my problem is how can I store everyone of them?
Tiago Correia
@tiagocorreiaalmeida
that's the problem I would have to name 1 by one?
class
per each
?
Ronique Ricketts
@RoniqueRicketts
I just found out w3schools has a nodejs class. :O
Tiago Correia
@tiagocorreiaalmeida
To search for multiple class names, separate them with spaces, like "test demo".
nm
Diego Mayer
@Chrono79
use map or forEach @tiagocorreiaalmeida
Adel
@AdelMahjoub
@tiagocorreiaalmeida
window.addEventListener('DOMContentLoaded', function() {
  var progress = document.querySelectorAll('.progress');

  progress.forEach(function(percentage) {
    console.log(percentage.getAttribute('progress'))
  });
});
Jason Luboff
@JLuboff
@AdelMahjoub Coming out of the shadows of backend eh?
Adel
@AdelMahjoub
@JLuboff lol
@JLuboff got me :smile:
Jason Luboff
@JLuboff
:D
Adel
@AdelMahjoub
I 'm sneaking in all the fcc gitter channels