These are chat archives for FreeCodeCamp/HelpJavaScript

29th
Nov 2017
Brian
@BrianCodes33
Nov 29 2017 03:19
class Vector{
  constructor (x,y) {
    this.x = x;
    this.y = y;
  }
  add(x,y) {
    this.x + this.y
  }
}
  Test.it("Vectors have correct y attributes.", _=> { Test.assertEquals(new Vector(3, 4).y, 4) } )
i dont know what im doing
Claudio Restifo
@Marmiz
Nov 29 2017 03:28
@BrianCodes33 Which testing language are you using?
The class seems fine to me, so it may be something wrong in the test assertion?
class Vector{
  constructor (x,y) {
    this.x = x;
    this.y = y;
  }
}

const z = new Vector(2,4);
z.y // 4
Brian
@BrianCodes33
Nov 29 2017 03:42
class Vector{
  constructor (x,y) {
    this.x = x;
    this.y = y;
  }
  add(x,y) {
    this.x + this.y
  }
}
Ken Haduch
@khaduch
Nov 29 2017 04:45
@BrianCodes33 - you are supposed to handle a vector as an argument to the add function - it would look like this:
class Vector {
    constructor (x, y) {
        this.x = x;
        this.y = y;
    }
    add(vec) {
        return new Vector( this.x + vec.x, this.y + vec.y ):
    }
}
Leo
@panchangzhi
Nov 29 2017 06:21
I want replace '-',but the result was not I want
"0_0 (: /-\ :) 0-0".toLowerCase().replace(/[\s|,|.|\-|_|\/]/g,'')
Youkieyuh
@Youkieyh
Nov 29 2017 07:45

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "";
// 请把你的代码写在这条注释以下
result = "dog big ran quickly";
result = "cat little hit slowly";
// 请把你的代码写在这条注释以上
return result;
}

wordBlanks("dog", "big", "ran", "quickly"); // 你可以修改这一行来测试你的代码
wordBlanks("cat", "little", "hit", "slowly");

有写这个的吗 我遇到问题了
Youkieyuh
@Youkieyh
Nov 29 2017 08:21
谢谢
@GitHub-Henry
Blauelf
@Blauelf
Nov 29 2017 10:21
@panchangzhi No need for those | within a character set. And you don't remove parentheses, colons, or backslashes. Maybe you could find a simpler regex that would remove any non-alphanumeric characters (in this problem, all non-alphanumeric are considered whitespace or punctuation).
nandoBel
@nandoBel
Nov 29 2017 10:31
Hi
button.addEventListener('click', function(){
jukebox.innerHTML = <video controls> <source src='https://www.youtube.com/watch?v=wH4kzAb4l0E'> </video>;
});
is it not possible to use a direct YT-link to an eventlistener?
It loads up the video controls properly in a div, but the video wont start
Blauelf
@Blauelf
Nov 29 2017 10:53
@nandoBel I know youtube videos only as an iframe option, is this kind of embedding documented somewhere?
Ghost
@ghost~59cdefc7d73408ce4f77dab0
Nov 29 2017 11:05
Guys I am making a script to autmatically change change background image every time the page reloads. I seem to figure it out but i am using i.length which sometimes comes same. Whow can I change this to be foolproof?
Tiago Correia
@tiagocorreiaalmeida
Nov 29 2017 11:06
well there's gonna bea limit of changes no?
you need to use localstorage maybe and avoid having the same image displaying
Ghost
@ghost~59cdefc7d73408ce4f77dab0
Nov 29 2017 11:06
Yea
I guess something like php
Tiago Correia
@tiagocorreiaalmeida
Nov 29 2017 11:06
no need if you are using js
Ghost
@ghost~59cdefc7d73408ce4f77dab0
Nov 29 2017 11:10
Okk
Rgr thx @tiagocorreiaalmeida
CamperBot
@camperbot
Nov 29 2017 11:10
parthprakash1 sends brownie points to @tiagocorreiaalmeida :sparkles: :thumbsup: :sparkles:
:cookie: 459 | @tiagocorreiaalmeida |http://www.freecodecamp.org/tiagocorreiaalmeida
Tiago Correia
@tiagocorreiaalmeida
Nov 29 2017 11:10
if(localStorage.getItem("myCat")){
  console.log(localStorage.getItem("myCat"));
}else{
  localStorage.setItem('myCat', 'Tom');
  console.log("local storage created");
}
try this
used mdn example just made something easier for you to test ou
out
Ghost
@ghost~59cdefc7d73408ce4f77dab0
Nov 29 2017 11:12
thanks
we can use switch right?
switch(localStorage.getItem){}
Tiago Correia
@tiagocorreiaalmeida
Nov 29 2017 11:13
well in your case I would only save the last item on the localstorage and avoid that the enxt callbrings the same item
cause your items gonna repeat anyway
Ghost
@ghost~59cdefc7d73408ce4f77dab0
Nov 29 2017 11:14
Yea
Tiago Correia
@tiagocorreiaalmeida
Nov 29 2017 11:14
plus if the idea is get a random image omn the start why a loop and not make something that gets you a random number and you use that position of the array to display the image
Ghost
@ghost~59cdefc7d73408ce4f77dab0
Nov 29 2017 11:14
Alright gives me a great idea
Tiago Correia
@tiagocorreiaalmeida
Nov 29 2017 11:14
an array of images of 6 images
and then generate a randomn number between 0 and 5
Ghost
@ghost~59cdefc7d73408ce4f77dab0
Nov 29 2017 11:15
Yea! Thanks @tiagocorreiaalmeida
CamperBot
@camperbot
Nov 29 2017 11:15
parthprakash1 sends brownie points to @tiagocorreiaalmeida :sparkles: :thumbsup: :sparkles:
api offline
Tiago Correia
@tiagocorreiaalmeida
Nov 29 2017 11:15
anytime, gl
tundeiness
@tundeiness
Nov 29 2017 11:20
can someone help check out my code for the wikipedia task? thank you...
(document).ready(function(){

  let searchString = document.getElementById('#searchString');

  $(".sbutton").on('click', function(){

    let baseUrl= " https://en.wikipedia.org/w/api.php?action "; 
    let tailUrl ="=query&format=json&prop=links&list=search&titles=searchString+&plnamespace=&srsearch=searchString";
    let wikiLink=baseUrl+tailUrl;

    $.ajax ({
          url:wikiLink,
          type:'GET',
          dataType:'json',
          success : function getWikiData(data){

          var wikiArray = [ ];
          for (var i = 0;  i < len(data.target);  i++){
          wikiArray.push(i);

            //create new paragraph 
          newParagraph = document.createElement("p");

          //create child nodes
          let paraText = document.createTextNode('wikiArray[i]'); 

          //add them as child nodes
          newParagraph.appendChild ("paraText"); 

          document.getElementById("container_div_name").appendChild(newParagraph);  
          }
        },

            error:function(error){
            console.log(error);
          }


    });


  });

});
Tiago Correia
@tiagocorreiaalmeida
Nov 29 2017 11:21
on the tailUrl shouldnt the searchstring be a variabl and not a string?
 let tailUrl ="=query&format=json&prop=links&list=search&titles=+"searchString"+&plnamespace=&srsearch=searchString";
you searching liteally for the word searchstring
Tiago Correia
@tiagocorreiaalmeida
Nov 29 2017 11:35
and on the top I think you mean this
$("document").ready(function(){
tundeiness
@tundeiness
Nov 29 2017 11:43
@tiagocorreiaalmeida sure I meant that
@tiagocorreiaalmeida searchString is the placeholder for the input made by the user. It is then passed into tailUrl as what is being sought for in wikipedia.
Tiago Correia
@tiagocorreiaalmeida
Nov 29 2017 11:46
(document).ready(function(){ is not written this way
as I said above
then the only thing that was missing was removing an empty space from the baseurl at the end
and change the tailurl to taken in the searchstring and not a non dynamic value
tundeiness
@tundeiness
Nov 29 2017 12:07
@tiagocorreiaalmeida noted..it's a cut and paste error on my part. It's not like that on my codepen though
@tiagocorreiaalmeida thanks for the tip.
CamperBot
@camperbot
Nov 29 2017 12:08
tundeiness sends brownie points to @tiagocorreiaalmeida :sparkles: :thumbsup: :sparkles:
:cookie: 461 | @tiagocorreiaalmeida |http://www.freecodecamp.org/tiagocorreiaalmeida
Tiago Correia
@tiagocorreiaalmeida
Nov 29 2017 12:08
checkthe code pen above you will need cors to make the request
the one above is working
and logs the data out
tundeiness
@tundeiness
Nov 29 2017 12:13
@tiagocorreiaalmeida and that exactly is where i am worried. I'm worried if I'm accessing the result from wiki the right way in the ajax, i'm worried if the loop will actually get them the way I want it to. I know if I run it, I'll get error somewhere but I need to narrow down to it (anticipating the error) before I actually run it.
Tiago Correia
@tiagocorreiaalmeida
Nov 29 2017 12:16
this is the last help im gonna give you on this before you running your code, part of coding isdebugging and understanding what's wrong by yourself, so you can be able to build stuff on your own
to get the length of an array on js
you dont use ```
< len(data.target)
 you use
data.target.length
plus you should first console.log the data thtat comes out from the api to see what's the object that contains the array so you can loop it
gl with it
tundeiness
@tundeiness
Nov 29 2017 12:30
@tiagocorreiaalmeida sigh...you guy's don't understand that you are not writing my code for me. of course i know about 'data' but what i'm unsure was if it should be data.target or data.name_of_search_string because what I see in the wiki sand box is the the result of the search nested as a list in the search_string which is also the holder for the result. See this format [ searchString[['wysiwyg'],['asdfgqwerty'],['wxyz']]]. That is the format of the result in the sandbox. now my concern is why use '.target' and why not use '.searchString[1]'(depending on what part of the result I need).
Markus Kiili
@Masd925
Nov 29 2017 12:33
@tundeiness Dot notation always looks for the exact string literal you write after the dot. It doesn't evaluate anything. With bracket notation you can evaluate the property key from an expression.
tundeiness
@tundeiness
Nov 29 2017 12:40
@Masd925 okay...so if I say data.searchString i'm right?
Markus Kiili
@Masd925
Nov 29 2017 12:47
@tundeiness That would look for property key "searchString" on the data object. Nothing to do with any variable searchString you might have.
data[searchString] would look for property key stored in variable searchString.
So bracket notation evaluates the expression inside the brackets and uses it as the property key.
Dot notation uses the key written after the dot.
tundeiness
@tundeiness
Nov 29 2017 12:51
@Masd925 you see while testing out the API in a sand box, assuming i searched using 'fox' and wikipedia shows me all the entries about fox in this manner:
[ fox [['a'],['b'],['c']]]
now if i now use dot notation i should do something like this data.fox[1]. since I want the result of the second array.
@Masd925 in the above case searchString is 'fox'
Stephen James
@sjames1958gm
Nov 29 2017 13:11
@tundeiness put the URL into the address bar and it should return the json that your code will receive.
tundeiness
@tundeiness
Nov 29 2017 13:21
@sjames1958gm true that...
tundeiness
@tundeiness
Nov 29 2017 13:49
@sjames1958gm now have a look at what i am saying:
[
    "machine learning",
    [
        "Machine learning",
        "Machine Learning (journal)",
        "Machine learning in bioinformatics",
        "Machine learning control",
        "Portal:Machine learning",
        "Category:Machine learning",
        "Talk:Machine learning",
        "Book:Machine Learning \u2013 The Complete Guide",
        "Machine learning ensemble",
        "Machine learning algorithms"
    ],
    [
        "Machine learning is a field of computer science that gives computers the ability to learn without being explicitly programmed.",
        "Machine Learning is a peer-reviewed scientific journal, published since 1986.",
        "Machine learning, a subfield of computer science involving the development of algorithms that learn how to make predictions based on data, has a number of emerging applications in the field of bioinformatics.",
        "Machine learning control (MLC) is a subfield of machine learning and control theory which solves optimal control problems with methods of machine learning.",
        "",
        "Machine learning is a branch of statistics and computer science, which studies algorithms and architectures that learn from observed facts.",
        "",
        "Currently Wikimedia does not provide enough server capacities to create a PDF version but here is on Google drive.",
        "",
        ""
    ],
    [
        "https://en.wikipedia.org/wiki/Machine_learning",
        "https://en.wikipedia.org/wiki/Machine_Learning_(journal)",
        "https://en.wikipedia.org/wiki/Machine_learning_in_bioinformatics",
        "https://en.wikipedia.org/wiki/Machine_learning_control",
        "https://en.wikipedia.org/wiki/Portal:Machine_learning",
        "https://en.wikipedia.org/wiki/Category:Machine_learning",
        "https://en.wikipedia.org/wiki/Talk:Machine_learning",
        "https://en.wikipedia.org/wiki/Book:Machine_Learning_%E2%80%93_The_Complete_Guide",
        "https://en.wikipedia.org/wiki/Machine_learning_ensemble",
        "https://en.wikipedia.org/wiki/Machine_learning_algorithms"
    ]
]
@Masd925 see above...what i'm asking is that to access the data, I can do data.machine learning? or is it still data.target? @sjames1958gm
Stephen James
@sjames1958gm
Nov 29 2017 13:51
data[0] -> "machine learning"
data[1][0] -> "Machine learning"
data[2][0] -> "Machine learning is a field of computer science that gives computers the ability to learn without being explicitly programmed.",
Assuming that this is data
If the array you showed above is stored in the variable data
tundeiness
@tundeiness
Nov 29 2017 13:56
@sjames1958gm okay..so no need for the dot notation as suggested by @Masd925 ?
Stephen James
@sjames1958gm
Nov 29 2017 13:56
From what I see these are all arrays, so no dot notation
tundeiness
@tundeiness
Nov 29 2017 13:57
@sjames1958gm okay. data[1] should do the trick. or data[2]
@sjames1958gm then i'll run a for loop over data[1]. and save it elsewhere.
Stephen James
@sjames1958gm
Nov 29 2017 13:58
@tundeiness :+1:
tundeiness
@tundeiness
Nov 29 2017 14:01
@sjames1958gm that's all i'm asking and dude like @tiagocorreiaalmeida keeps suggesting that I want him to write my code for me....at the long run I get to write my code my self after explanation of the format...
Stephen James
@sjames1958gm
Nov 29 2017 14:03
I would use console.log of the data and more console.log as I drill down into the separate parts of the data to find the correct syntax.
Tiago Correia
@tiagocorreiaalmeida
Nov 29 2017 14:23
@tundeiness what me and others suggested was atually test your own code and try to debug it, you asked for help without even running it once, but ok won't happen again
tundeiness
@tundeiness
Nov 29 2017 14:32
@sjames1958gm great!!!
@tiagocorreiaalmeida of course!! you do not need to respond to my ask for help next time..if there will be one then.
Tiago Correia
@tiagocorreiaalmeida
Nov 29 2017 14:33
uh ok
tundeiness
@tundeiness
Nov 29 2017 14:33
sheeesh!
some folks here attach too much importance to themselves...freecode camp says 'if you are stuck ask for help' not write the code for them...someone ask you tell the person to run the code but the person knows something is wrong and the so called 'experts' says run the code or else we won't help you. sigh!! if you do not help others will...folks are not like you sir!
better to keep QUIET!! if you do not have anything to offer. Now ask me what did @sjames1958gm lose by seeing through my discussion with him? Nothing!!
tundeiness
@tundeiness
Nov 29 2017 14:40
empty barrels!
Kelechi Chinaka
@ke1echi
Nov 29 2017 14:47
calm down bro @tundeiness
i think everyone here tries to help in their own little way
:wave: greetings @tiagocorreiaalmeida @sjames1958gm
tundeiness
@tundeiness
Nov 29 2017 14:50
@kelechy I have had help when I needed it. this one is just to condescending. Either help or shuush. but @sjames1958gm helped...without conditions too. he has done it in the past and he's still helping out. Now that is what I call help. Not some wannabes.
@kelechy i'm calm bro..I just needed to get it off my chest.
Aizaz Shahid
@aizazshahid
Nov 29 2017 15:12
@tundeiness what's up ? forwebtech here
and how is your progress going ?
Nerando Johnson
@Nerajno
Nov 29 2017 16:05
@sjames1958gm ..... greetings ..... Oh dear lord
Stephen James
@sjames1958gm
Nov 29 2017 16:05
@Nerajno Hello
Tiago Correia
@tiagocorreiaalmeida
Nov 29 2017 16:06
@sjames1958gm living the dream :D
Nerando Johnson
@Nerajno
Nov 29 2017 16:06
lol
Stephen James
@sjames1958gm
Nov 29 2017 16:06
@tiagocorreiaalmeida :sleepy:
Tiago Correia
@tiagocorreiaalmeida
Nov 29 2017 16:07
:D how's everything?
alpox
@alpox
Nov 29 2017 16:07
@tundeiness Please don't call off people when they try to help. And thats exactly what @tiagocorreiaalmeida tried to do. He was giving you a well suited advice.
Nerando Johnson
@Nerajno
Nov 29 2017 16:08
So i joined a Chingu's voyage .... fun so far... i feel like a vw in a ferrari race......
alpox
@alpox
Nov 29 2017 16:08
@tiagocorreiaalmeida :wave:
Tiago Correia
@tiagocorreiaalmeida
Nov 29 2017 16:08
@alpox all cool dont worry, how's your project going?
alpox
@alpox
Nov 29 2017 16:10
@tiagocorreiaalmeida Got in the middle of the charts ;-) there is still air to top. I scored 87% accuracy when classifying the dataset. Best position is atm. 89%.
We did some feature selection to remove features out of the testing which were not very representative and got a better score through that - now i'm running a gridsearch again for finding the best parameters for the classifier
But it runs for around 4-5 hours now :-/ my laptop is just too slow for such tasks
Tiago Correia
@tiagocorreiaalmeida
Nov 29 2017 16:11
everytime you need to test it you need 4 hours for to get some resulsts? :D that's some pain in the .. :D
alpox
@alpox
Nov 29 2017 16:11
Not really, testing and training itself doesn't take so long, but the hyperparameter tuning does
What that thing does, is trying a lot of different combinations of possible parameters to the classifier function - together with cross validation (Splitting the trainset in different places and try each of the splits). Every time it tries, it calculates its accuracy and in the end outputs the best parameters to the classifier
Subsequent trainings are easy because you can then just use those parameters
And thats faster
Tiago Correia
@tiagocorreiaalmeida
Nov 29 2017 16:18
I was reading a bit about it since I know 0 off it :D hyperparameter are like parameters set for the start of a learning process?
alpox
@alpox
Nov 29 2017 16:19
Yes exactly
Well you create a classifier through a function call - with certain parameters to the function
Hyperparameter tuning is nothing else than testing possible parameters to the classifier function and see which one creates the best result ^^
Nothing fancy about it
Tiago Correia
@tiagocorreiaalmeida
Nov 29 2017 16:20
sounds not confusing at all
tundeiness
@tundeiness
Nov 29 2017 16:31
@tundeiness
@alpox LOOOOOOOOL do you know how many folks on here has given me their codes privately to check out as a solution to my challenge and I have refused to check it because I wanted to learn ? and you say @tiagocorreiaalmeida is telling me the right thing? KMT as if I didn't know the right thing before I came to ask everyone. Like I said don't talk if you can't help Simple!. Not calling people off. Besides did you see me mention any names?
@aizazshahid ah!! my friend! can we do private chat please? Thank you for coming to my aid.
CamperBot
@camperbot
Nov 29 2017 16:31
tundeiness sends brownie points to @aizazshahid :sparkles: :thumbsup: :sparkles:
:cookie: 733 | @aizazshahid |http://www.freecodecamp.org/aizazshahid
Nerando Johnson
@Nerajno
Nov 29 2017 16:47
So here is the issue that I am having or rather what I need to happen or get logged. { the channel website, and if its offline from the request}
````
var channels =["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas", "brunofin", "comster404","RealKraftyy?"];
//Runs Jquery
$("document").ready(function(){
  // Fetches FCC Stream info and api status call
  //The main api
  var url2 = "https://wind-bow.glitch.me/twitch-api/streams/";
  var i = 0;
  while (i <channels.length){
    //Adds the channels from the array
    var url3 = url2+channels[i];
    // var channel_listing = channels[i];
     // console.log(channels[i]);
    // console.log(url3);
    $.getJSON(url3,function(data){
      console.log(url3);
      var exercise = data.stream;
      // var title = data.stream.channel.display_name;
      console.log(exercise);
      if (exercise === null) {
        console.log("The "+channels[i]+" is Offline");
      }else {
        var title = data.stream.channel.display_name;
        console.log("The channel is "+title);
    //     // var url3 = url2+channels[i];
    //     // console.log(url3);
    //     // console.log("This array number"+ counter);
      }
    });
    i++;
  }
  });
any help with it
i will be back
Markus Kiili
@Masd925
Nov 29 2017 16:56
@Nerajno All those getJSON callback functions seem to be using the same url3 variable that has the last assigned value when those callback function execute (after the loop has run out). i will be channels.length at that point so channels[i] will be undefined.
Nerando Johnson
@Nerajno
Nov 29 2017 17:00
So the channel value will be the same in each loop
?
@Masd925
Markus Kiili
@Masd925
Nov 29 2017 17:02
@Nerajno Those getJSON method calls just give those callback functions to the browser to be executed later when the responses come. They all use the same url3 and i variables that have the values assigned last.
@Nerajno Typical error. There are many ways around it.
Nerando Johnson
@Nerajno
Nov 29 2017 17:05
@Masd925 wanna teach ?
.... rather hold it .... i got client wrk to do but i shall return to solve it before the day is out
Markus Kiili
@Masd925
Nov 29 2017 17:05
@Nerajno ok.
Nerando Johnson
@Nerajno
Nov 29 2017 17:05
@Masd925 thank you
CamperBot
@camperbot
Nov 29 2017 17:05
nerajno sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 4587 | @masd925 |http://www.freecodecamp.org/masd925
If prop isn't "tracks" and value isn't empty (""), update or set the value for that record album's property.
function updateRecords(id, prop, value) {
  if(prop != "tracks" && value != "") {
    return value;
  }
I don't think return value is correct
how do I update or set the value for that record album's property
Stephen James
@sjames1958gm
Nov 29 2017 19:32
@karinafarina the id parameter is used to select an album (which is an object) from the collection.
With that object you can use [] and = to set the value on the object's property.
Nazzal Naseer
@enemen101
Nov 29 2017 19:33
hey guys! I have an HTML project that my client wants me to convert to reactjs. do any of you guys know how I can go about doing that?
I did get most of it done but for some reason, the svg won't show up
karinafarina
@karinafarina
Nov 29 2017 19:35
@sjames1958gm I don't understand.
Brad
@bradtaniguchi
Nov 29 2017 19:36
@enemen101 what do you mean svg wont show up>
?*
Simon Cordova
@gbsimon87
Nov 29 2017 20:11
Hey all, was wondering if someone could help me with a little piece of jQuery?
Christopher McCormack
@cmccormack
Nov 29 2017 20:27
ask away @gbsimon87
Simon Cordova
@gbsimon87
Nov 29 2017 20:27
@cmccormack thanks a lot but I actually figured it out, had to get a pen and paper and map it out, but ended up using the each function and it worked like a charm :)
CamperBot
@camperbot
Nov 29 2017 20:27
gbsimon87 sends brownie points to @cmccormack :sparkles: :thumbsup: :sparkles:
:star2: 1279 | @cmccormack |http://www.freecodecamp.org/cmccormack
Christopher McCormack
@cmccormack
Nov 29 2017 20:28
I wish more people used that tool :)
Simon Cordova
@gbsimon87
Nov 29 2017 20:28
It's a beauty and time saver at times to be honest
Christopher McCormack
@cmccormack
Nov 29 2017 20:32
just in case any confusion i meant pen and paper :joy:
AbrisM
@AbrisM
Nov 29 2017 20:56
Hi, could someone explain why my code is not working? I am converting from jquery to vanilla javascript but it won't type out any letters on the page. https://jsfiddle.net/qnoshanr/1/
Stephen James
@sjames1958gm
Nov 29 2017 21:06
@AbrisM console - says you are missing a ) near the end
AbrisM
@AbrisM
Nov 29 2017 21:16
@sjames1958gm Which line?
Stephen James
@sjames1958gm
Nov 29 2017 21:16
@AbrisM I think the very last
Or remove the ( in front of the , (function which is not needed
@karinafarina Sorry I was away from my desk.
collection[id] selects an album
Devin Miller
@edwin0258
Nov 29 2017 21:51
:tada: :tada: Approved :D https://www.codewars.com/kata/game-of-go
AbrisM
@AbrisM
Nov 29 2017 21:53
@Stephen Hmm I've tried that, and it created another error haha for the ) part
function updateRecords(id, prop, value) {
  if(prop != "tracks" && value != "") {
    id[]
  }
I need help
I get the first part but not how to update the value for the record album's property
Daniel
@DanJP2016
Nov 29 2017 22:10
I'm working on the build a calculator project and I'm trying to use the shunting-yard algorithm for parsing and evaluating the math input. So far the program works when inputing data like "1 + 1 = 2, + 1 = 3", and when inputing " 1+ 1+1 = 3", but when trying to input more than that " 1 + 1 + 1 + 1 = 4", the program returns 3 and NaN is stored in the stack. I built a test pen to try to isolate the problem but I still can't figure out where i went wrong. would appreciate any help.
https://codepen.io/bones211/pen/MOzbzo?editors=0011
Kaz Baig
@kbaig
Nov 29 2017 22:22
@karinafarina how to update an object's property
const person = {
  name: 'Kaz',
  age: 21
};

person.name = 'Kaz Baig';

person; // { name: 'Kaz Baig', age: 21 }
Bryan Reese
@breese8009
Nov 29 2017 22:37
yooo
import React, { Component, PropTypes } from 'react'

const Counter = ({ value, onIncrement, onDecrement }) =>
      <div>
        <button onClick={onIncrement}>
          Increment
        </button>
        {' '}
        <button onClick={onDecrement}>
          Decrement
        </button>
        <hr />
        <div>
          Clicked: {value} times
        </div>
      </div>

Counter.propTypes = {
  value: PropTypes.number.isRequired,
  onIncrement: PropTypes.func.isRequired,
  onDecrement: PropTypes.func.isRequired
}

export default Counter
what is the Counter.propTypes?
is that isRequired?
@edwin0258 :eyes:
Devin Miller
@edwin0258
Nov 29 2017 22:41
@breese8009 I don't think that's required. It's just adds type checking I'm pretty sure.
Kaz Baig
@kbaig
Nov 29 2017 22:47
@edwin0258 @breese8009 that's right
Brian
@BrianCodes33
Nov 29 2017 23:39
i am trying to append a jquery class to a mobile view that is in the desktop view. any clues?