These are chat archives for FreeCodeCamp/HelpJavaScript

19th
Jan 2018
Jefferson
@jeffersonnnn
Jan 19 2018 14:59

hi guys, first and foremost: thank you for the community feel of this place. Whenever, i come back, it never feels like. So here is m problem: i am trying to implement a carousel effect on a web page, i think(?) i am getting the code right, but the effect isn't just happening. Here is my script.js code

var slideInterval = 3500;

function getFigures() {
    return document.getElementById('carousel').getElementsByTagName('figure');
}

function moveForward() {
    var pointer;
    var figures = getFigures();
    for (var i = 0; i < figures.length; i++) {
        if (figures[i].className == 'visible') {
            figures[i].className = '';
            pointer = i;
        }
}
if (++pointer == figures.length) {
    pointer = 0;
}

figures[pointer].className = 'visible';
setTimeout(moveForward, slideInterval);

function startPlayback() {
    setTimeout(moveForward, slideInterval);
}

startPlayback();

Please somebody, anybody, give me a clue as to where error is.

Stephen James
@sjames1958gm
Jan 19 2018 15:09
@jeffersonnnn Where is the end of the moveForward function? Missing }
Jefferson
@jeffersonnnn
Jan 19 2018 15:24

It works! It works! It works! cue maniacal laughter

Thanks @sjames1958gm , you rock.

CamperBot
@camperbot
Jan 19 2018 15:24
jeffersonnnn sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
api offline
Simon Cordova
@gbsimon87
Jan 19 2018 15:40
Hello!
Anybody have any experience with ontouchstart?
Diego Mayer
@Chrono79
Jan 19 2018 15:44
not me
Stephen James
@sjames1958gm
Jan 19 2018 16:02
@jeffersonnnn :+1:
Jason Luboff
@JLuboff
Jan 19 2018 16:08
@gbsimon87 Nope!
Simon Cordova
@gbsimon87
Jan 19 2018 16:09
Cheers anyways guys :)
Jason Luboff
@JLuboff
Jan 19 2018 16:10
Cheers!
It is Friday afterall
Kaz Baig
@kbaig
Jan 19 2018 16:10
Cheeeeeeeeers
Ima be cheerin later tonight
Jason Luboff
@JLuboff
Jan 19 2018 16:11
I'll be sleeping later tonight :P
Right now, I need to figure out why my damn sql query isn't working
Kaz Baig
@kbaig
Jan 19 2018 16:11
Oh yeah that'll still be happening in a timely fashion. Planning for today's travels did not leave me a lot of time to sleep :(
ooh can I help
Jason Luboff
@JLuboff
Jan 19 2018 16:13
I wish you could haha. The query works fine in SSMS it's a problem with it in my program
I think initially it was becuase I was using a UNC path, thus escape characters were being added
Kaz Baig
@kbaig
Jan 19 2018 16:13
Oh that's unfortunate
Jason Luboff
@JLuboff
Jan 19 2018 16:13
but now I switched to using a like operand and its still not liking it
Kaz Baig
@kbaig
Jan 19 2018 16:16
My favorite case of character insertion was when using the console to debug PubNub functions. URL encoded strings were logging as plain text so I spent hours thinking the error in my code was related to that instead of my API config
Jason Luboff
@JLuboff
Jan 19 2018 16:18
I'm too tired to even start to understand what this PubNub is lol
ARRRGGHHHHH :(
Kaz Baig
@kbaig
Jan 19 2018 16:20
It's what Uber etc use as serverless real-time data stream architecture
Functions is like AWS Lambda if you're familiar with that, ie do something with the payload while it's on its way
Jason Luboff
@JLuboff
Jan 19 2018 16:22
Interesting, seems beyond my grasp of knowledge :P
Kaz Baig
@kbaig
Jan 19 2018 16:22
They guarantee delivery of your payload within 250ms, so the server architecture is really their core competency
dinesh
@1532j0004kg
Jan 19 2018 16:23
$(document).ready(function(){

   var usernam = $('#username').val();
   var passwor = $('#password').val();

$("#register").click(function(){
  $.ajax({
    type : 'post',
    url : 'http://localhost:8000/login',
    data :  {
      username : usernam,
      password : passwor
    },
    ContentType : "application/json",
    dataType : "json",
    success : function(data,err){
     console.log(data);

     if(err)
       console.log(err);
   }

    });
  });
});
hi guys , this is not posting the data.
can u pls say,y?
Jason Luboff
@JLuboff
Jan 19 2018 16:24
@kbaig Alright..maybe you can help me.. you ever setup a trace in SQL Server Profiler to watch for inbound queries? I want to see what my query looks like to the server
Kaz Baig
@kbaig
Jan 19 2018 16:24
@JLuboff I can only help on the query side sorry bud haha
I've never done it from a dev perspective
dinesh
@1532j0004kg
Jan 19 2018 16:24
username and password are the my collection struct.
Jason Luboff
@JLuboff
Jan 19 2018 16:25
@kbaig You disappoint me :P
Kaz Baig
@kbaig
Jan 19 2018 16:25
I disappoint me too
so we have something in common
@1532j0004kg one issue is ContentType rather than contentType
and type should be method
Jason Luboff
@JLuboff
Jan 19 2018 16:26
type is ok
Kaz Baig
@kbaig
Jan 19 2018 16:27
Oh I just found it nvm
I'm literally just reading the above docs page
Type is too general of a word to ctrl+f
Jason Luboff
@JLuboff
Jan 19 2018 16:27
I would probably change the url to url: '/login'
dinesh
@1532j0004kg
Jan 19 2018 16:27
ContentType i gave correctly
stringify wanna to use?
Sweet Coding :)
@SweetCodingInc
Jan 19 2018 16:35
@1532j0004kg either say wanna or say want to.. wanna to is bad and redundant ;)

@1532j0004kg the reason the data is not posted is that you're doing

var usernam = $('#username').val();
var passwor = $('#password').val();

on document ready. You want to do that when you click the button

You need to do
$("#register").click(function(){
  var usernam = $('#username').val();
  var passwor = $('#password').val();
  $.ajax({
    type : 'post',
    url : 'http://localhost:8000/login',
    data :  {
      username : usernam,
      password : passwor
    },
    ContentType : "application/json",
    dataType : "json",
    success : function(data,err){
     console.log(data);

     if(err)
       console.log(err);
   }

    });
  });
or even better
$(document).ready(function() {
  var usernam = $('#username');
  var passwor = $('#password');

  $('#register').click(function() {
    $.ajax({
      type: 'post',
      url: 'http://localhost:8000/login',
      data: {
        username: usernam.val().trim(),
        password: passwor.val().trim(),
      },
      ContentType: 'application/json',
      dataType: 'json',
      success: function(data, err) {
        console.log(data);

        if (err) console.log(err);
      },
    });
  });
});
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 16:39
@JLuboff I am grateful for the informattion
dinesh
@1532j0004kg
Jan 19 2018 16:42
if i used without stringify it shows the error of bad request.
@SweetCodingInc
but we need to stringify , when we need to send data to server right?
Sweet Coding :)
@SweetCodingInc
Jan 19 2018 16:43
You also need to set method: 'post' not type:'post'
dinesh
@1532j0004kg
Jan 19 2018 16:44
y method we need to give?
Sweet Coding :)
@SweetCodingInc
Jan 19 2018 16:44
@1532j0004kg never mind...
you can use type as well
dinesh
@1532j0004kg
Jan 19 2018 16:45
ok can u please tell purpose of contenttype?
Sweet Coding :)
@SweetCodingInc
Jan 19 2018 16:45
@1532j0004kg I will in a moment
before that, can you show your login code you have on your server?
dinesh
@1532j0004kg
Jan 19 2018 16:46
ok
sure
var express = require("express");
var router = express.Router();
var mongoose = require('mongoose');

var usersSchema = mongoose.Schema({
  username : String,
  password : String
});

var usersModel = mongoose.model('users' , usersSchema);

router.post('/login' ,function(req,res){

  var newUser = new usersModel();
  newUser.username = req.body.username;
  newUser.password = req.body.password;
  newUser.save(function(err,savedObject){
   if(err)
   {
    res.statusCode(500).send();
   }
   else {
       res.send(savedObject);
   }
  });
});

module.exports = router;
Sweet Coding :)
@SweetCodingInc
Jan 19 2018 16:47
sweet
hold on
dinesh
@1532j0004kg
Jan 19 2018 16:48
:smile:
sure
Jason Luboff
@JLuboff
Jan 19 2018 16:48
@RoniqueRicketts Which information?
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 16:55
@JLuboff about the passport.js
I am late, I got distracted with trading btc so I haven't coded much since year :(
Sweet Coding :)
@SweetCodingInc
Jan 19 2018 17:01
@1532j0004kg I'm back
Let me take a look at your code
Don't see any major problems
can you tell me whats the exact error you're getting?
Kaz Baig
@kbaig
Jan 19 2018 17:02
@RoniqueRicketts what are your transaction confirmation times looking like?
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 17:03
@kbaig meaning?
dinesh
@1532j0004kg
Jan 19 2018 17:03
when i posting ,the data's are posted ,but with empty.
it means the data's i given are not sended properly
Sweet Coding :)
@SweetCodingInc
Jan 19 2018 17:03
@1532j0004kg Exactly... Then do what I told you.
Get values from your inputs after you click the button
dinesh
@1532j0004kg
Jan 19 2018 17:04
but sended with empty
ok
Kaz Baig
@kbaig
Jan 19 2018 17:05
@RoniqueRicketts how long from when you request a transaction is your exchange confirming that it occurred
I'm hearing lead times like 7 days
Jason Luboff
@JLuboff
Jan 19 2018 17:06
@RoniqueRicketts Ah, of course. I bought some bitcoin..now just seeing what it does (I bought an initial $25 at 15.8 then it dropped a bunch so I bought another $25 at 11.2 which shoould get me back to my initial investment at some point :joy: )
dinesh
@1532j0004kg
Jan 19 2018 17:06
@SweetCodingInc perfectits working
then can u pls say y ?
its not accepting when i get the data outside event?
and also verymuch thanks
:smile:
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 17:08
@kbaig I trade on hitbtc. I mine alt coins and trade but I havent sent any money to my wallet in a while
Sweet Coding :)
@SweetCodingInc
Jan 19 2018 17:08

@1532j0004kg I already told you

You want to do that when you click the button

You're reading value from you input at the time of document ready. (using .val)
when the document ready event is triggered, your inputs are empty
you will enter values in your inputs AFTER your document is ready.
And you will click button when you're done entering the values
so you want to read values after you click the button, when you know the input is entered
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 17:10
@JLuboff good transfer that balance to a online trader and buy some alt coins, its possible you can double or triple within a week.
Jason Luboff
@JLuboff
Jan 19 2018 17:11
@RoniqueRicketts I don't know enough about crypto to get into that, let alone to know which coins to get into
Kaz Baig
@kbaig
Jan 19 2018 17:11
I'm still trying to save a 6 month emergency fund
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 17:11
I started from $0.01 USD I started September and By December I was up to $40
dinesh
@1532j0004kg
Jan 19 2018 17:11
@SweetCodingInc gotit!
Kaz Baig
@kbaig
Jan 19 2018 17:11
then after that I'll think about putting this finance degree to some use
dinesh
@1532j0004kg
Jan 19 2018 17:12
then one more u earlier said u teach me application/json is what ?
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 17:12
@JLuboff you cant go wrong with ETH, BCH and KBR (Japanese coin that will be used for gaming tokens)
dinesh
@1532j0004kg
Jan 19 2018 17:12
can u pls tell (i want to know)
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 17:12
I'd love to learn how to code cryptos'
Sweet Coding :)
@SweetCodingInc
Jan 19 2018 17:13
@1532j0004kg Its the type of data you expect from the server
Jason Luboff
@JLuboff
Jan 19 2018 17:13
@RoniqueRicketts How would I transfer from coinbase to an exchange?
Sweet Coding :)
@SweetCodingInc
Jan 19 2018 17:13
When you set content type to application/json, jQuery will convert data from the server to js object.
if you don't set it, you will have to manually parse the string to js object.
dinesh
@1532j0004kg
Jan 19 2018 17:14
for that only i gave the type : json
Sweet Coding :)
@SweetCodingInc
Jan 19 2018 17:14
nope. you gave dataType
not type.
You've set type to post
dinesh
@1532j0004kg
Jan 19 2018 17:14
yes :smile:
Sweet Coding :)
@SweetCodingInc
Jan 19 2018 17:15
dataType will stringify your data object to JSON
because you have dataType: 'json'
but since you've already set content type, you can safely remove dataType
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 17:17
@JLuboff What do you think about the react course that's offering on udacity where they place us in a job?
Re: prev message. you will have to sigin up on a exchange market like binance or hitbtc then use the deposit option in the exchange tool and you will get an address to send the funds. You can then send the coin from your wallet to the exchange tool.
dinesh
@1532j0004kg
Jan 19 2018 17:17
then y i used stringify ?
Jason Luboff
@JLuboff
Jan 19 2018 17:17
@kbaig Fuck. I think I found out my issue.. I was using a .NET method .ExecuteNonQuery which returns the number of row's affected.. well its meant to be used only with DML statements.. hence why it wasn't working for me with a Select statement :neutral_face:
dinesh
@1532j0004kg
Jan 19 2018 17:17
@SweetCodingInc
then y i used stringify ?
Sweet Coding :)
@SweetCodingInc
Jan 19 2018 17:18
@1532j0004kg You did not.
Where did you use stringify?
Jason Luboff
@JLuboff
Jan 19 2018 17:18
@RoniqueRicketts I haven't heard of that course. I haven't had time to really look into React unfortunately :(
I'll check out hitbtc or biancee then
dinesh
@1532j0004kg
Jan 19 2018 17:18
$(document).ready(function(){

$("#register").click(function(){
  $.ajax({
    type : "post",
    url : 'http://localhost:8000/login',
    data : JSON.stringify({
      username : $('#username').val(),
      password : $('#password').val()
    }),
    contentType : "application/json",
    dataType : 'json',
    success : function(data,err){
     console.log(data);
     if(err)
       console.log(err);
   }

    });
  });
});
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 17:19
@JLuboff lol ok
Sweet Coding :)
@SweetCodingInc
Jan 19 2018 17:19
@1532j0004kg You don't need to
This is enough
$.ajax({
    type: 'post',
    url: 'http://localhost:8000/login',
    data: {
        username: $username.val().trim(),
        password: $password.val().trim(),
    },
    ContentType: 'application/json',
    success: function (data, err) {
        console.log(data);

        if (err) console.log(err);
    },
});

Also, instead of doing

console.log(data);

if (err) console.log(err);

you can simply do

console.log(err ? err : data);
dinesh
@1532j0004kg
Jan 19 2018 17:20
but when i gave with stringify it shows err(bad request);
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 17:21
@JLuboff https://www.udacity.com/course/react-nanodegree--nd019 they claim they place us in jobs or money back....
Sweet Coding :)
@SweetCodingInc
Jan 19 2018 17:22
@1532j0004kg Then don't do it :laughing:
dinesh
@1532j0004kg
Jan 19 2018 17:23
hehe :smile:
i think dataType tells that what type of data client will accept.
Sweet Coding :)
@SweetCodingInc
Jan 19 2018 17:24
Yes
It's all given here
Jason Luboff
@JLuboff
Jan 19 2018 17:28
@RoniqueRicketts Well.. it is a pretty hefty upfront cost but if they get you a job you'll easily recover that..
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 17:29
@JLuboff lol I plan to use my cryptocoins money to pay for it heheh.
Jason Luboff
@JLuboff
Jan 19 2018 17:29
But it is a 4 month course. Roughly 192 hours of work total.
dinesh
@1532j0004kg
Jan 19 2018 17:30
@SweetCodingInc this is what i expected.
thanks @1532j0004kg
CamperBot
@camperbot
Jan 19 2018 17:31
sorry 1532j0004kg, you can't send brownie points to yourself! :sparkles: :sparkles:
dinesh
@1532j0004kg
Jan 19 2018 17:31
:smile:
thanks @SweetCodingInc
CamperBot
@camperbot
Jan 19 2018 17:31
1532j0004kg sends brownie points to @sweetcodinginc :sparkles: :thumbsup: :sparkles:
:cookie: 198 | @sweetcodinginc |http://www.freecodecamp.org/sweetcodinginc
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 17:31
@JLuboff yup, but I plan to get it for free (useing my btc money to pay for it) I wanted to get good at react and also get a job :)
Sweet Coding :)
@SweetCodingInc
Jan 19 2018 17:31
@1532j0004kg :+1:
Jason Luboff
@JLuboff
Jan 19 2018 17:33
@RoniqueRicketts I thought you had a coding job of some sort?
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 17:34
@JLuboff turns out the guy is a big time waster who wanted someone to code for $2 an hour. I wanted to smack him with my shoe, I felt disrespected.
Jason Luboff
@JLuboff
Jan 19 2018 17:35
@RoniqueRicketts Ah, thats shitty. Sorry to hear that
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 17:37
@JLuboff Ya its ok, its a lesson. I am not phased by it, I just gotta focus on getting better at what I can do so I can be a good enough programmer.
Jason Luboff
@JLuboff
Jan 19 2018 17:39
Thats a good attitude to have
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 17:48
I don't give up easily man.
Pieter Stokkink
@forkerino
Jan 19 2018 17:49
@RoniqueRicketts I'm learning solidity (ethereum programming language) at the moment. It's not that different from js, but has a couple gotchas.
Using a nice course on Udemy
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 17:49
@forkerino wow nice. heard this is the best coin in terms of security.
@forkerino what do u think of the udacity nanodegree program?
Jason Luboff
@JLuboff
Jan 19 2018 17:52
What would be the purpose of learning solidity? @forkerino
Pieter Stokkink
@forkerino
Jan 19 2018 17:52
@RoniqueRicketts the job guarantee is nice, but you can learn React without spending the money, so depending on the job market in your location it might or might not be worth it.
@JLuboff coding smart contracts
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 17:53
@forkerino pssh. Its hard to find a programming job in Jamaica.
Jason Luboff
@JLuboff
Jan 19 2018 17:53
which does...what exactly? (I went the easy route of coinbase so I really don't know much in regards to crypto)
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 17:55
@JLuboff well it seem like a hot bread
@forkerino I would only do it for the job part of it and also to learn react from another person.
Pieter Stokkink
@forkerino
Jan 19 2018 17:57
@JLuboff smart contracts can be used to put things we would put in a normal contract on the blockchain, making it verifiable by anyone. You can also program in the terms (i.e. when such a thing happens, a payment is done, etc.).
Jason Luboff
@JLuboff
Jan 19 2018 17:58
Ah... interesting
Pieter Stokkink
@forkerino
Jan 19 2018 17:59
@RoniqueRicketts I did a fantastic course on React on Udemy (as well, actually by the same guy - Stephen Grider - who does the Solidity course), learned a ton and if you code along you'll definitely pick up a lot of skills.
Paid ~15 euros for it when it was on sale
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 18:00
@forkerino I like that. I am gonna get some react practice then buy the udacity course.
Pieter Stokkink
@forkerino
Jan 19 2018 18:01
Of course, it is not as extensive as the nanodegree, but I don't really know what more there is to learn except dive deep into the source code.... and together with a couple other courses I consider myself pretty proficient in React. It all depends on building some projects using React.
For work I'm doing AngularJS now, in combination with Redux, but we may switch to React or Vue later this year, depending on how well Angular JS will maintain when we start scaling.
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 18:02
@forkerino the reason I will do the nanodegree is the gurantee job. Plus I wont pay for it out of my pocket.
Heard that React is best for scaling vs Vue or Angular.
Blauelf
@Blauelf
Jan 19 2018 18:03
@forkerino Do you remember the Ethereum/Ethereum Classic split? As far as I understand, a mistake in their smart contract made it necessary.
Pieter Stokkink
@forkerino
Jan 19 2018 18:07
@Blauelf I do remember that, it was because of a bug in a single smart contract which was created by a DAO (which called itself 'the DAO'). It got a lot of traction early on, because it was the first of its kind, but because of the bug, there was a lot of money lost to a hacker. They forked to undo the hack, and everyone suddenly had Ether and Ether Classic (where classic is the continuation of the hacked branch). I understand why they chose to fork, because of the amount of people affected by it, but some purists claim this is not what blockchain is supposed to be like.
Matej BoĆĄnjak
@mbosnjak01
Jan 19 2018 18:09
Hi. Anyone tried working with http://opalang.org/ ?
Ronique Ricketts
@RoniqueRicketts
Jan 19 2018 18:13
I might make a little app for my android that can tell me the price of the coins I follow. https://api.hitbtc.com/
Christopher
@bradley1492
Jan 19 2018 19:07

Hey, I am just working on the https://www.freecodecamp.org/challenges/exact-change challenge.
I just read through the hints, FCC gives me, but I can't understand what they mean with this one:

"Life is easier when you get to know the value of each currency type in the register instead of how much money is composed of that particular currency. So be sure to watch out for that."

I honestly don't quite know what this sentence means, as I already seem to know, what values are linked to each currency...?

Diego Mayer
@Chrono79
Jan 19 2018 19:09
@bradley1492 I think it means 3 x 0.50 instead of 1.50 of 0.50?
Not sure tho
Christopher
@bradley1492
Jan 19 2018 19:10
@Chrono79 Oh okay, that could make sence, I already thought that the keys of the properties in the cid array will be funny to deal with.
I am not quite sure how to work with them as they seem to be words and not numbers. At least that is my initial thought at the beginning :)
Diego Mayer
@Chrono79
Jan 19 2018 19:11
I would suggest you work in cents
Jason Luboff
@JLuboff
Jan 19 2018 19:12
@Chrono79 No one likes to work for cents though :(
Diego Mayer
@Chrono79
Jan 19 2018 19:13
Beggars aren't choosers :P
Damn capitalism
Jason Luboff
@JLuboff
Jan 19 2018 19:19
:)
Christopher
@bradley1492
Jan 19 2018 19:29
@Chrono79 I think I can manage to work in cents in general, but I can't think how in this array I would work with the words as keys.
Do you mean I should convert the keys to cents?
[["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.10], ["QUARTER", 4.25], ["ONE", 90.00], ["FIVE", 55.00], ["TEN", 20.00], ["TWENTY", 60.00], ["ONE HUNDRED", 100.00]]
Diego Mayer
@Chrono79
Jan 19 2018 19:35
not the keys, no, the values
I can't access any of my past solutions, anyone else has this problem?
Christopher
@bradley1492
Jan 19 2018 19:38
@Chrono79 yes this I will do anyway --> converting the values to cents.
But I wonder how to deal with the words.
Jason Luboff
@JLuboff
Jan 19 2018 19:39
@Chrono79 I clicked on view solution...and there is no solution in there
Diego Mayer
@Chrono79
Jan 19 2018 19:40
on your own or on my profile?
Jason Luboff
@JLuboff
Jan 19 2018 19:40
@Chrono79 My own, I don't care about yours :P
Diego Mayer
@Chrono79
Jan 19 2018 19:40
lol
give us back our solutions!
They're making millions right now with them :P
Christopher
@bradley1492
Jan 19 2018 19:41
hahahaha
Mark
@vinarius
Jan 19 2018 19:44
I remember that challenge. That one took me a while.
Diego Mayer
@Chrono79
Jan 19 2018 19:47
@JLuboff you can still get it using something like this and pasting the url of the solution link
I dunno if the problem is related to accesing the beta of freecodecamp
Christopher
@bradley1492
Jan 19 2018 19:50
It seemed easy at first, but just now I grasp the more deep nature of it...
Deep for my point of view^^
Jason Luboff
@JLuboff
Jan 19 2018 19:52
@Chrono79 Ah. Either way I have all my solutions saved in a Onenote notebook'
I could download all my code in a zip
Jason Luboff
@JLuboff
Jan 19 2018 19:58
I :heart: vertical screen for coding
jusgoose
@gusd773
Jan 19 2018 21:13
HELP

HELP

/*function destroyer(arr) {

return arguments[0].filter(notThose(val){
    return val !== arguments[1] && val !== arguments[2];                              
                           });

}

// USE FILTER TO TAKE OUT ARGUMENT[1.]

destroyer([1, 2, 3, 1, 2, 3], 2, 3); */
SAYS MY SYNTAX IS OFF

Markus Kiili
@Masd925
Jan 19 2018 21:14
@gusd773 The filter callback function has its own arguments object.
The number of destroyers arguments is not known so you need to loop or iterate them.
jusgoose
@gusd773
Jan 19 2018 21:15
@Masd925 so even if i put the 2 last arguments into another array i couldn't filter them through that?
Markus Kiili
@Masd925
Jan 19 2018 21:15
@gusd773 You could put all the extra arguments after the array into another array, yes.
jusgoose
@gusd773
Jan 19 2018 21:15
if so how would that look? I am trying to get the hang of the filter syntax as it's confusing,
@gusd773 @Masd925
Markus Kiili
@Masd925
Jan 19 2018 21:16
@gusd773 You can do var args = Array.prototype.slice.call(arguments,1); and then solve it using arr and args.
arr is the passed array and args holds the extra arguments.
You need to loop or iterate args inside filter callback function.
Jason Luboff
@JLuboff
Jan 19 2018 21:24
@Masd925 :wave:
Markus Kiili
@Masd925
Jan 19 2018 21:24
@JLuboff Hi.
Jason Luboff
@JLuboff
Jan 19 2018 21:24
Whats the good word?
Markus Kiili
@Masd925
Jan 19 2018 21:27
@JLuboff I think I might have broken my knee today. There was a loud pop when I was carrying another guy on my back. No pain but most likely something broken.
Jason Luboff
@JLuboff
Jan 19 2018 21:27
...why were you carrying another guy?
Markus Kiili
@Masd925
Jan 19 2018 21:27
@JLuboff BJJ training.
@JLuboff Back to training chess :rat:
Jason Luboff
@JLuboff
Jan 19 2018 21:30
@Masd925 Makes sense, I guess :D
Markus Kiili
@Masd925
Jan 19 2018 21:35
@JLuboff Chess is the most deadly sport in the world.
Jason Luboff
@JLuboff
Jan 19 2018 21:35
I always enjoyed checkers over chess...but I'm not big on either