These are chat archives for FreeCodeCamp/HelpJavaScript

24th
Jul 2017
Dovydas Stirpeika
@Giveback007
Jul 24 2017 00:00
nas is cloned from csa
nas is 'new age state'
csa 'current age state'
Marcus Parsons
@marcusparsons
Jul 24 2017 00:18
@Hijerboa, it fixes the issue of the API only being called once. What other issue are you having?
CallMeOrange
@EgnaroDev
Jul 24 2017 01:33
I completed Search and Replace but can anyone take a look at my code to see if it is good?
I will post my code just in case
function myReplace(str, before, after) {
  str = str.split(" ");
  var index = str.indexOf(before);
  var replaced = str.splice(index, 1, after);
  if (before == before[0].toUpperCase() + before.slice(1, before.length))
    str.splice(
      index,
      1,
      str[index][0].toUpperCase() + str[index].slice(1, str[index].length)
    );
  else str.splice(index, 1, after);
  return str.join(" ");
}
myReplace("Let us get back to more Coding", "Coding", "algorithms");
John
@AnonymousLords
Jul 24 2017 01:51
uhhh
e=mc2
kumquatfelafel
@kumquatfelafel
Jul 24 2017 01:52
@MCTwoDigitZero you could just have before[0] === before[0].toUpperCase()
CallMeOrange
@EgnaroDev
Jul 24 2017 01:54
@kumquatfelafel oh my, you are right.. by the end isn't necessary
@kumquatfelafel Just curious, whats your code for this?
dyon3334
@dyon3334
Jul 24 2017 01:57
Codecamp vs treehouse or do both ?
CallMeOrange
@EgnaroDev
Jul 24 2017 01:57
function myReplace(str, before, after) {
  str = str.split(" ");
  var index = str.indexOf(before);
  var replaced = str.splice(index, 1, after);
  if (before[0] === before[0].toUpperCase())
    str.splice(
      index,
      1,
      str[index][0].toUpperCase().concat(str[index].slice(1, str[index].length))
    );
  else str.splice(index, 1, after);
  return str.join(" ");
}
myReplace("Let us get back to more Coding", "Coding", "algorithms");
@dyon3334 fCC
kumquatfelafel
@kumquatfelafel
Jul 24 2017 01:57
@MCTwoDigitZero
function myReplace(str, before, after) {
  if (isUpperCase(before.charAt(0))) {
    var charReplace = after.charAt(0).toUpperCase();
    after = charReplace.concat(after.substr(1));
  }
  return str.replace(before, after);
}

function isUpperCase(char) {
  return char === char.toUpperCase() && char !== char.toLowerCase();
}
CallMeOrange
@EgnaroDev
Jul 24 2017 01:57
I used + but totally forgot .concat()
Hm..
How long have you work with algorithms?
silver537
@silver537
Jul 24 2017 01:59
@kumquatfelafel why did you create another function?
kumquatfelafel
@kumquatfelafel
Jul 24 2017 01:59
Concat isn't necessarily best option i don't think... was just going through a kind of "concat" phase at the time.
@silver537 because I felt like it. :p
CallMeOrange
@EgnaroDev
Jul 24 2017 01:59
I used + but totally forgot .concat()
kumquatfelafel
@kumquatfelafel
Jul 24 2017 01:59
also not even remotely necessary though.
CallMeOrange
@EgnaroDev
Jul 24 2017 01:59
That wasn't for your code :p
Just a coincidence
I skipped two algorithms just because I wanted to work on Search and Replace... Looked fun
__mifflin__
@cdrainxv
Jul 24 2017 02:03
@dyon3334: If you have the money use as many resources as you can. It will help you reinforce what you have learned. Keep in mind, however, there a ton of free resources online.
kumquatfelafel
@kumquatfelafel
Jul 24 2017 02:06
@MCTwoDigitZero technically, what I did was wrong.
CallMeOrange
@EgnaroDev
Jul 24 2017 02:07
your code?
kumquatfelafel
@kumquatfelafel
Jul 24 2017 02:07

Yup.

Consider following function call.

myReplace("He is sleeping on the couch", "sleeping", "Sitting");

CallMeOrange
@EgnaroDev
Jul 24 2017 02:08
oh lol
I'm probably too tired to ask for help for this... but I'm really stuck on Roman Numeral Converter
@kumquatfelafel Can you take a look at my code to see if I'm on right way?
kumquatfelafel
@kumquatfelafel
Jul 24 2017 02:10
Looking back, I think I misunderstood what was asking to do at time, got that particular test case wrong and was like "Oh, that's what they meant!". Never bothered to fully fix haha
CallMeOrange
@EgnaroDev
Jul 24 2017 02:10
function convertToRoman(num) {
  var romanNum = [
    "I",
    "IV",
    "V",
    "IX",
    "X",
    "XL",
    "L",
    "XC",
    "C",
    "CD",
    "D",
    "CM",
    "M"
  ];
  var Num = [1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500, 900, 1000];
  var arr = [];
  for (var i = 0; i < romanNum.length; i++) {
    arr.push([num].indexOf(Num[i]));
  }
  index = arr.indexOf(0);
  return romanNum[index];
}
convertToRoman(5);
lol
kumquatfelafel
@kumquatfelafel
Jul 24 2017 02:14

@MCTwoDigitZero start off well, but I would maybe call Num numbers or something so follow naming conventions and also so there's no confusion with num.

Also, not sure what this is.

([num].indexOf(Num[i]))

CallMeOrange
@EgnaroDev
Jul 24 2017 02:15
well.. num is 5 but .indexOf only works on an array, so [num], I used .indexOf on it to find the number in Num array
So I get something like -1 -1 -1 -1 0
index = arr.indexOf(0); index give me the index of 0 then used it to convert the number to roman number
Yeah I guess that about it
I think you would understand if you used repl.it or something to run this code
CamperBot
@camperbot
Jul 24 2017 02:20
:bulb: to format code use backticks! ``` more info
kumquatfelafel
@kumquatfelafel
Jul 24 2017 02:22
@MCTwoDigitZero Thing is, you're missing a fair amount of the calculation that would be necessary to make something like this work. For example, what if num isn't 5, but 1496?
CallMeOrange
@EgnaroDev
Jul 24 2017 02:23
Yeah.. Thats what I'm trying to figure out...
Well I guess I'll take a break then redo it
@kumquatfelafel thanks
CamperBot
@camperbot
Jul 24 2017 02:23
mctwodigitzero sends brownie points to @kumquatfelafel :sparkles: :thumbsup: :sparkles:
:cookie: 530 | @kumquatfelafel |http://www.freecodecamp.com/kumquatfelafel
kumquatfelafel
@kumquatfelafel
Jul 24 2017 02:25
@MCTwoDigitZero the two arrays at start is pretty much identical to what I had.
CallMeOrange
@EgnaroDev
Jul 24 2017 02:27
Yeah, most commonly used I guess
I had like I V X etc... but someone told me to add like 4, 9, 40 etc..
kumquatfelafel
@kumquatfelafel
Jul 24 2017 02:29

Thats what I'm trying to figure out...

Well let's think of it for moment in terms of our number array. 1496 requires the 1000, the 400, 90, 5, and 1.

CallMeOrange
@EgnaroDev
Jul 24 2017 02:29
Yeah, someone also sent me a link for that lol
if 1490 = 1000, 400, 90...
@kumquatfelafel thanks but try to not help me, I'd like to figure this out by myself
CamperBot
@camperbot
Jul 24 2017 02:31
mctwodigitzero sends brownie points to @kumquatfelafel :sparkles: :thumbsup: :sparkles:
:warning: mctwodigitzero already gave kumquatfelafel points
CallMeOrange
@EgnaroDev
Jul 24 2017 02:31
:smile:
Kei Nart
@codenart
Jul 24 2017 02:31
@MCTwoDigitZero :+1:
kumquatfelafel
@kumquatfelafel
Jul 24 2017 02:32
@MCTwoDigitZero not going beyond there unless request. :p
Kei Nart
@codenart
Jul 24 2017 02:32
@kumquatfelafel :+1:
CallMeOrange
@EgnaroDev
Jul 24 2017 02:33
@kumquatfelafel thanks but try to not help me, I'd like to figure this out by myself
CamperBot
@camperbot
Jul 24 2017 02:33
mctwodigitzero sends brownie points to @kumquatfelafel :sparkles: :thumbsup: :sparkles:
:warning: mctwodigitzero already gave kumquatfelafel points
CallMeOrange
@EgnaroDev
Jul 24 2017 02:33
Unless I request some help
:trollface:
Alright I'll make a "vow" for today
I have to figure it out whatever I can, if I can't then I'll have to ask for help tomorrow
:wave:
kumquatfelafel
@kumquatfelafel
Jul 24 2017 02:34
night
(off as well I think)
Pjdaze
@Pjdaze
Jul 24 2017 02:41
any mentors :(
javascript mentorship needed here
Kei Nart
@codenart
Jul 24 2017 02:43
@Pjdaze I'm not pro but wanna help.
What's ur prob?
Pjdaze
@Pjdaze
Jul 24 2017 02:44
@codenart im gonna pm you
Kei Nart
@codenart
Jul 24 2017 02:44
Ok
Pjdaze
@Pjdaze
Jul 24 2017 02:45
ok maybe i cant pm from an iphone can u pm me plz
Conor Murphy
@cmurphy580
Jul 24 2017 03:34
Hey i'm trying to get an HTML file to work on a local server, by running a npm package.json through the command line. Not a hundred percent certain on what i'm doing there, but I cant get the file to show up on the page
any ideas
?
Nitin Sahu
@globefire
Jul 24 2017 03:53

function destroyer(arr, n1, n2) {
  //                                                                                                                                            Remove all the values 
  //arr.filter(n1 || n2);
  for(var i =0; i < arr.length; i++){
    if(arr[i] === n1 || arr[i] === n2){
     // arr.pop(i);
      //delete arr[i];
      arr.pop(i);
    }
     }
  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
what is wrong in this ?
somebody help
Stanley Su
@stanley-su
Jul 24 2017 03:55
@globefire pop only takes off areay elememts at the end. You should look into using splice
Nitin Sahu
@globefire
Jul 24 2017 03:56
ohh i see thanks man
Pjdaze
@Pjdaze
Jul 24 2017 04:20
thanks so much!!!! @codenart
CamperBot
@camperbot
Jul 24 2017 04:20
pjdaze sends brownie points to @codenart :sparkles: :thumbsup: :sparkles:
:cookie: 360 | @codenart |http://www.freecodecamp.com/codenart
Kei Nart
@codenart
Jul 24 2017 04:20
@Pjdaze Nothin' at all. Happy coding.
Ogundele Olumide
@Lumexralph
Jul 24 2017 04:25
@globefire the function you're given on FCC takes a parameter not three, using the arguments array-like object and indexOf will be a of great help in your code challenge
Maks Ushakov
@maks-ushakov
Jul 24 2017 04:44

@cmurphy580

Hey i'm trying to get an HTML file to work on a local server, by running a npm package.json through the command line. Not a hundred percent certain on what i'm doing there, but I cant get the file to show up on the page

what package do you use? Try to use node-static

create file server.js

var http = require('http');
var static = require('node-static');
var file = new static.Server('.');

http.createServer(function(req, res) {
  file.serve(req, res);
}).listen(8080);

run node server.js

in browser localhost:8080

iso
@iso1048
Jul 24 2017 04:46
for the "Wherefore art thou" challenge, is it ok to make the code work only when the source contains a max of 2 keys?
heroiczero
@heroiczero
Jul 24 2017 04:47
@gothamknight i did it for every source
iso
@iso1048
Jul 24 2017 04:48
@heroiczero ok cool. thanks
CamperBot
@camperbot
Jul 24 2017 04:48
gothamknight sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1525 | @heroiczero |http://www.freecodecamp.com/heroiczero
Ghulam Shabir
@ghulamshabir
Jul 24 2017 05:39
@maks-ushakov you will need to use fs path url and http modules
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 05:42
@ghulamshabir He already has node-static
What that piece of code does is, it will consider __dirname as base path and serve files relative to that path
Ghulam Shabir
@ghulamshabir
Jul 24 2017 05:46
@SweetCodingInc I never used node-static so not sure about that, but in order to server files he will need fs and url.
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 05:48
@ghulamshabir node-static is an abstraction for doing just that :)
Ghulam Shabir
@ghulamshabir
Jul 24 2017 05:49
@SweetCodingInc oh good to know that, that's how we learn :smile:
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 05:49
@ghulamshabir :+1:
Conor Murphy
@cmurphy580
Jul 24 2017 05:54
@maks-ushakov thanks for the help!
CamperBot
@camperbot
Jul 24 2017 05:54
cmurphy580 sends brownie points to @maks-ushakov :sparkles: :thumbsup: :sparkles:
:cookie: 370 | @maks-ushakov |http://www.freecodecamp.com/maks-ushakov
Eric K
@EricK425
Jul 24 2017 07:22
Hello all. can someone please help me with a syntax error.. unexpected token ; - I have no idea whats happening
Ahmad Abdolsaheb
@ahmadabdolsaheb
Jul 24 2017 07:22
@EricK425 can I see your code?
Eric K
@EricK425
Jul 24 2017 07:23
function sumFibs(num) {

  var fib1 = 1;
  var fib2 = 1;
  var fibarr = [1, 1];
  var fib3;

  do {
    fib3 = fib1 + fib2;

    if (fib3 %2 != 0 && fib3 <= num) {
      fibarr.push(fib3);
      fib1 = fib2;
      fib2 = fib3;
    }

    else 
      fib1 = fib2;
      fib2 = fib3;

  }
  while (fib3 <= num);

  return fibarr;
}
Sulaiman
@suli-g
Jul 24 2017 07:23

URL shortener microservice

Updates:

  • Now has an input form for shortening URLs (takes original URL only as input)
  • Checks database for duplicate and returns stored shortened URL
  • Uses pug templating
Eric K
@EricK425
Jul 24 2017 07:24
@ahmadabdolsaheb I don't know if the alrogithm is correct, but Im jsut confused why it says unexpected syntax error ;
Manish Giri
@Manish-Giri
Jul 24 2017 07:25
@EricK425
   else 
      fib1 = fib2;
      fib2 = fib3;
use { } if you've got multiple statements
Eric K
@EricK425
Jul 24 2017 07:25
@Manish-Giri I did that..
@Manish-Giri let me try again
Markus Kiili
@Masd925
Jul 24 2017 07:26
@EricK425 There is no syntax error there.
Eric K
@EricK425
Jul 24 2017 07:26
@Masd925 I keep getting syntax error...
@Masd925 I was ripping my hair out bc I dont see a syntax error! lol
Markus Kiili
@Masd925
Jul 24 2017 07:27
@EricK425 Runs fine in repl.it
Eric K
@EricK425
Jul 24 2017 07:27
@Masd925 what is repl.it
Markus Kiili
@Masd925
Jul 24 2017 07:28
@EricK425 A site where you can run JS.
Eric K
@EricK425
Jul 24 2017 07:28
@Masd925 Its not working on the fcc page for me.. ill try repl
Markus Kiili
@Masd925
Jul 24 2017 07:34
@EricK425 Yes, FCC complains about unexpected token, but I can't see anything wrong.
Eric K
@EricK425
Jul 24 2017 07:34
@Masd925 Ok so I'm not taking crazy pills.
@Masd925 I got undefined returned in repl
Markus Kiili
@Masd925
Jul 24 2017 07:35
@EricK425 Did you call the function?
Conor Murphy
@cmurphy580
Jul 24 2017 07:36
i'm requesting the use of the microphone. I want it to stop asking my permission. Any ideas?
Eric K
@EricK425
Jul 24 2017 07:36
@Masd925 NM I got what I was looking for.. now Ijust need to reduce the array.. should I let fCC know that that alrogtihm syntax page is broken?
Manish Giri
@Manish-Giri
Jul 24 2017 07:37
@Masd925 do you know if indexOf() can be used to locate objects in an array?
Eric K
@EricK425
Jul 24 2017 07:37
@Manish-Giri I believe so
Markus Kiili
@Masd925
Jul 24 2017 07:37
@Manish-Giri Yes it can.
Manish Giri
@Manish-Giri
Jul 24 2017 07:37
like
let obj1 = {name: "John Doe", age: 20};
let persons = [obj1];
console.log(persons.indexOf(obj1));
all right, ty @Masd925 @EricK425
CamperBot
@camperbot
Jul 24 2017 07:38
manish-giri sends brownie points to @masd925 and @erick425 :sparkles: :thumbsup: :sparkles:
:cookie: 298 | @erick425 |http://www.freecodecamp.com/erick425
:star2: 4328 | @masd925 |http://www.freecodecamp.com/masd925
Markus Kiili
@Masd925
Jul 24 2017 07:38
@Manish-Giri It uses strict equality for finding elements.
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 07:39
@Manish-Giri That will work as long as references are same.
If you're passing in an object as a parameter to the function, it won't work
Blauelf
@Blauelf
Jul 24 2017 07:41
@SweetCodingInc Objects are stored/passed as references, so why should a parameter not work? The only point is that you couldn't compare by content.
Markus Kiili
@Masd925
Jul 24 2017 07:42
@SweetCodingInc The parameter has a copy of the reference, so nothing changes.
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 07:43
@Blauelf Consider this
function checkIfItIsThere(obj, arr){
  // find if obj.id exists in arr
}

checkIfItIsThere({id:3, name:'C'}, arr);
Commonly found pattern in mongoose apps.
Blauelf
@Blauelf
Jul 24 2017 07:44
@SweetCodingInc What is that supposed to do? Without some specification, that code does not tell me anything.
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 07:44
if you run arr.indexOf(obj) you will get -1
Eric K
@EricK425
Jul 24 2017 07:44
function sumFibs(num) {

  var fib1 = 1;
  var fib2 = 1;
  var fibarr = [1, 1];
  var fib3;

  do {
    fib3 = fib1 + fib2;

    if (fib3 %2 !== 0 && fib3 <= num) {
      fibarr.push(fib3);
      fib1 = fib2;
      fib2 = fib3;
    }

    else {
      fib1 = fib2;
      fib2 = fib3;
    }

  }
  while (fib3 <= num);

fibarr.reduce(function(sum, value) {
  return sum + value;
});
}





sumFibs(4);
why wont reduce work? it returns undefined
Manish Giri
@Manish-Giri
Jul 24 2017 07:45
@EricK425 fibarr.reduce
Blauelf
@Blauelf
Jul 24 2017 07:45
@EricK425 You don't return the result of reduce
Manish Giri
@Manish-Giri
Jul 24 2017 07:45
stick a return in front
Eric K
@EricK425
Jul 24 2017 07:45
@Manish-Giri ok thanks. but why? now I have two returns.. but it worked
CamperBot
@camperbot
Jul 24 2017 07:45
erick425 sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 6314 | @manish-giri |http://www.freecodecamp.com/manish-giri
Markus Kiili
@Masd925
Jul 24 2017 07:46
@SweetCodingInc We were talking about passing a reference to a function. There you are constructing a new object and passing it.
Eric K
@EricK425
Jul 24 2017 07:46
@Blauelf I pretty much copied that from the MDN. what do you mean you don't return the result of reduce
Blauelf
@Blauelf
Jul 24 2017 07:46
@EricK425 One return per function. return returns from the current function to the calling one.
Manish Giri
@Manish-Giri
Jul 24 2017 07:46
return sum + value; - this return tells reduce how to reduce the array into a single value
but you still need to return the reduced value from the function
let answer = fibarr.reduce(function(sum, value) {
  return sum + value;
});
return answer;
if that makes more sense..
@EricK425
Eric K
@EricK425
Jul 24 2017 07:47
@Blauelf Ok. Thanks. I'll need to read more into that. This is technically recursion right? I have trouble understand that
CamperBot
@camperbot
Jul 24 2017 07:47
erick425 sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star2: 4528 | @blauelf |http://www.freecodecamp.com/blauelf
Blauelf
@Blauelf
Jul 24 2017 07:47
@EricK425 reduce returns something to your outer function (here a sum), and you ignored that rather than returning it to the calling code.
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 07:48
@EricK425 You're not calling sumFibs within sumFibs so that's not a recursion
Blauelf
@Blauelf
Jul 24 2017 07:48
@EricK425 Not exactly recursion. Reduce is like tail recursion turned into a loop.
Eric K
@EricK425
Jul 24 2017 07:48
@Blauelf So now Im pretty sure I have the alorithm correct but the syntax error on fCC isnt working so I dont know what to do..
Markus Kiili
@Masd925
Jul 24 2017 07:50
@SweetCodingInc Just passing doesn't do anything to references:
var obj = {name: "John"};
var arr = [obj];

function find(elem,array){
  return array.indexOf(elem);
}

find(obj,arr); // 0
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 07:51
@Masd925 : Okay... We're not on same page..
Blauelf
@Blauelf
Jul 24 2017 07:52
@SweetCodingInc Nothing to do with the function, but are you trying to do a recursive compare on each element? Like compare by content rather than by reference?
Markus Kiili
@Masd925
Jul 24 2017 07:52
@SweetCodingInc You were constructing a new object on the call, which of course is not equal to some object on the array.
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 07:54
@Blauelf Yes.. mostly, in real apps, where you're dealing with user input, it's highly unlikely that you will get the same reference back...
For example
const arr = [
  {
    name:'A',
    id:1
  },
  {
    name:'B',
    id:2
  },
  {
    name:'C',
    id:3
  },
  {
    name:'D',
    id:4
  }
];

const find = (obj, arr) => arr.findIndex(i => i.id == obj.id);

const thisIsUserInput = {
  id:3,
  name:'C'
}

console.log(find(thisIsUserInput, arr));
will work as thisIsUserInput is something that you get from external source
not necessarily the same object
Blauelf
@Blauelf
Jul 24 2017 07:55
Not all algorithms deal with user input in this way.
Eric K
@EricK425
Jul 24 2017 07:55
Does anyone know how I can tell fCC about that alrogithm not working bc of a syntax error? There used to be a help button but now I don't see it.
Blauelf
@Blauelf
Jul 24 2017 07:56
@EricK425 Can you show the code? Maybe we find some non-matching parentheses or something like that.
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 07:56
@Blauelf :point_up: Hence this!
Eric K
@EricK425
Jul 24 2017 07:56

@Blauelf it works in repl just fine

```

function sumFibs(num) {

  var fib1 = 1;
  var fib2 = 1;
  var fibarr = [1, 1];
  var fib3;

  do {
    fib3 = fib1 + fib2;

    if (fib3 %2 !== 0 && fib3 <= num) {
      fibarr.push(fib3);
      fib1 = fib2;
      fib2 = fib3;
    }

    else {
      fib1 = fib2;
      fib2 = fib3;
    }

  }
  while (fib3 <= num);

return fibarr.reduce(function(sum, value) {
  return sum + value;
});
}





sumFibs(10);
@Blauelf Intermediate alo. sum all odd fibonacci
Blauelf
@Blauelf
Jul 24 2017 07:57
@EricK425 I think something does not like do..while, try regular while.
Markus Kiili
@Masd925
Jul 24 2017 07:58
@SweetCodingInc No problem there. Just trying to make it clear what you were talking about. Sure you have to make your own function if you wan't to compare content or find an object with same content instead of finding the same reference.
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 07:58
@Masd925 :+1:
Eric K
@EricK425
Jul 24 2017 07:58
@Blauelf Can I just say while(code) {
and this code is executed?
}
Blauelf
@Blauelf
Jul 24 2017 08:00
@EricK425 I thought of it more like
function sumFibs(num) {

  var fib1 = 1;
  var fib2 = 1;
  var fibarr = [1, 1];
  var fib3;

  while ((fib3 = fib1 + fib2) <= num) {
    if (fib3 % 2 !== 0) {
      fibarr.push(fib3);
    }
    fib1 = fib2;
    fib2 = fib3;
  }

  return fibarr.reduce(function(sum, value) {
    return sum + value;
  });
}
Eric K
@EricK425
Jul 24 2017 08:01
@Blauelf Its just weird that it works in another Javascript console.. I properly used do while
@Blauelf That worked. Thank you. Still bugging me a little bit
CamperBot
@camperbot
Jul 24 2017 08:02
:warning: erick425 already gave blauelf points
erick425 sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
Blauelf
@Blauelf
Jul 24 2017 08:02
@EricK425 Yeah, I know. It's probably a bug, but as I rarely use do..while (it rarely makes sense, also not in your case, which does not require the loop to be run at least once)... I'm too lazy to check for existing bug reports or file one myself.
Manish Giri
@Manish-Giri
Jul 24 2017 08:04
@EricK425 in your code -
while (fib3 <= num);
take off the ; at the end, and it'll work..
theoretically, the ; is correct syntax..
not sure why CommonJS complains..
Blauelf
@Blauelf
Jul 24 2017 08:04
@Manish-Giri But isn't that ; correct, and even recommended?
Eric K
@EricK425
Jul 24 2017 08:04
@Manish-Giri its works and I get all green checks but it wont complete the challenge
I always thought it was good practice to use a ; after while
Markus Kiili
@Masd925
Jul 24 2017 08:05
It is to my knowledge.
Manish Giri
@Manish-Giri
Jul 24 2017 08:05
@Blauelf right, as I said, it's correct..and I'm not sure why it fails..
theoretically, the ; is correct syntax..
@EricK425 I tried it, it worked for me..
se.png
Eric K
@EricK425
Jul 24 2017 08:08
@Manish-Giri What browser?
Manish Giri
@Manish-Giri
Jul 24 2017 08:08
@EricK425 chrome
Eric K
@EricK425
Jul 24 2017 08:08
@Manish-Giri weird..
@Manish-Giri Well I got it to work @Blauelf way. Thanks to both of you again
CamperBot
@camperbot
Jul 24 2017 08:09
erick425 sends brownie points to @manish-giri and @blauelf :sparkles: :thumbsup: :sparkles:
:warning: erick425 already gave blauelf points
:warning: erick425 already gave manish-giri points
Manish Giri
@Manish-Giri
Jul 24 2017 08:09
maybe file a bug report at fcc's github repo
I dont know what to do
I havent coded in like 3 weeks I forgot what I did
I added some stuff but Im not sure if its gonna work
Stanley Su
@stanley-su
Jul 24 2017 08:31
@ArchivalBoat50 Looking at your current code, I recommend that you close your html tags.
@ArchivalBoat50 You should just try to fulfill the user stories first. Try to get data for each streamer you’re displaying. Then load that data into the DOM.
GeorgeII
@GeorgeII
Jul 24 2017 08:41

How can I remove 0's in the end of my float number? I've got float number with fixed 3 digits after the point. If it's 0 I need to remove it. For example: 1/2=0.500 and I need only 0.5. I use replace function and regex:

expression = expression.replace(/\.[0-9]+(0+)$/g, "");

but this code remove the whole number. So how can I solve this problem?

Claudio Restifo
@Marmiz
Jul 24 2017 08:43
@GeorgeII there is a toFixed methods for floating n
GeorgeII
@GeorgeII
Jul 24 2017 08:43
In my case function replace the whole number with emptyness
@Marmiz but if I want to 1/2 the result will be 0.500
and I need to remove 00 in the end
Claudio Restifo
@Marmiz
Jul 24 2017 08:44
@GeorgeII but if you have a n=1.123 you want to keep it as it is?
GeorgeII
@GeorgeII
Jul 24 2017 08:44
yes
Stanley Su
@stanley-su
Jul 24 2017 08:45
@GeorgeII wait this is in javascript right? doesn’t js automatically remove trailing zeros?
GeorgeII
@GeorgeII
Jul 24 2017 08:46
@stanley-su No, if I use toFixed(3) it doesn't
Stanley Su
@stanley-su
Jul 24 2017 08:47
@GeorgeII wait, you only want 3 decimal points? is it initially a string or a number
@GeorgeII If it’s initially a string, then you can just convert it into a number and it will remove the trailing zeroes. Then you can use toFixed().
If it’s initially a number, then it should be fine.
GeorgeII
@GeorgeII
Jul 24 2017 08:49
@stanley-su if it'll help, str17 in js https://codepen.io/GeorgeIV/pen/YxKeJB
Claudio Restifo
@Marmiz
Jul 24 2017 08:52
@GeorgeII best way to do this in JS is converting it to a string (so zeroes are ignored) and then back to a number, then add it to a fixed value as @stanley-su suggested:
Number(yourn.toFixed(3))
but you'll still probably have some edge case
GeorgeII
@GeorgeII
Jul 24 2017 08:55
yeah, it works
@stanley-su @Marmiz ty very much
CamperBot
@camperbot
Jul 24 2017 08:55
georgeii sends brownie points to @stanley-su and @marmiz :sparkles: :thumbsup: :sparkles:
:cookie: 77 | @stanley-su |http://www.freecodecamp.com/stanley-su
:star2: 1006 | @marmiz |http://www.freecodecamp.com/marmiz
GeorgeII
@GeorgeII
Jul 24 2017 09:01
And one more question. Do you know where I can find pure code of such functions as replace, split, splice etc?
Claudio Restifo
@Marmiz
Jul 24 2017 09:03
pure code?
GeorgeII
@GeorgeII
Jul 24 2017 09:05
declaration of functions, how they are defined in js
U can read full JS references there
GeorgeII
@GeorgeII
Jul 24 2017 09:13
@codenart can't find it there
For example, in C/C++ I can open a header file and look at the code
Kei Nart
@codenart
Jul 24 2017 09:16
Ah.. u mean that u want to read source
simply log the function without calling it
Markus Kiili
@Masd925
Jul 24 2017 09:17
@GeorgeII You can't get it for built-in functions.
GeorgeII
@GeorgeII
Jul 24 2017 09:17
If I include <string> header file I can see how find_first_of function work
so
in js it's impossible?
Markus Kiili
@Masd925
Jul 24 2017 09:18
For built-in functions, it is generally impossible. There might be info about some specific engines and how the functions are implemented.
GeorgeII
@GeorgeII
Jul 24 2017 09:22
@Masd925 @codenart ok ty. I can't fluently speak English. That's my problem. I couldn't describe what I wanted :smile:
CamperBot
@camperbot
Jul 24 2017 09:22
georgeii sends brownie points to @masd925 and @codenart :sparkles: :thumbsup: :sparkles:
:cookie: 361 | @codenart |http://www.freecodecamp.com/codenart
:star2: 4329 | @masd925 |http://www.freecodecamp.com/masd925
GeorgeII
@GeorgeII
Jul 24 2017 09:23
now I got it
Kelechi Chinaka
@ke1echi
Jul 24 2017 09:34
where can i learn more oop in js
Markus Kiili
@Masd925
Jul 24 2017 09:37
@kelechy There are some books and video courses out there. You can also read on MDN about objects and how they can be used.
Owais Ahmed
@owaisehmed
Jul 24 2017 09:38
Hey guys
has anyone done the factorialize?
Markus Kiili
@Masd925
Jul 24 2017 09:38
@owaisehmed Yes.
Owais Ahmed
@owaisehmed
Jul 24 2017 09:38
may i see some solutions?

function factorialize(num) {
  if (num>0){
  var count = num-1;
  while(count > 0){
    num = num * count;
    count --;
  }
  return num;
  }
  else return 1;
}

factorialize(5);
This is my code
Markus Kiili
@Masd925
Jul 24 2017 09:39
@owaisehmed Post your solution on https://gitter.im/FreeCodeCamp/CodeReview and ask for feedback. Here it might spoil someones work.
Owais Ahmed
@owaisehmed
Jul 24 2017 09:39
I actually wanna see other logics.
so as to know other programming ideas it could have been done with besides mine
Markus Kiili
@Masd925
Jul 24 2017 09:40
@owaisehmed ok. https://gitter.im/FreeCodeCamp/CodeReview is still a better place.
Ghulam Shabir
@ghulamshabir
Jul 24 2017 10:33
@owaisehmed I sent you the solution in private chat
Owais Ahmed
@owaisehmed
Jul 24 2017 11:38
str = str.toLowerCase().replace(/[^A-Za-z0-9]/g,'');
  var temp = str;

  for(var i = 0,j = temp.length-1; i<str.length;i++,j--){
    if(str[i] == temp[j])
      return true;
    else return false;
  }
 }
where am i wrong?
Markus Kiili
@Masd925
Jul 24 2017 11:41
@owaisehmed Palindrome challenge?
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 11:41
@owaisehmed You're returning true way too early.
Markus Kiili
@Masd925
Jul 24 2017 11:42
@owaisehmed Less confusing if you just use one index i.
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 11:42
for string test first and last characters are same and thus your if conditon will reutrn true
Owais Ahmed
@owaisehmed
Jul 24 2017 11:42
@SweetCodingInc yeah i thought the same
shall i use flag instead?
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 11:42

@owaisehmed

What you need to do instead is, check for inequality. If it is true, then return false

when loop is over, return true as it is as you didn't find any inequality
function pal(str){

str = str.toLowerCase().replace(/[^A-Za-z0-9]/g,'');
  var temp = str;

  for(var i = 0,j = temp.length-1; i<str.length;i++,j--){
    if(str[i] !== temp[j])
      return false;
  }

  return true;
}
Owais Ahmed
@owaisehmed
Jul 24 2017 11:43
i tried doing that but wasnt able to
Markus Kiili
@Masd925
Jul 24 2017 11:44
@SweetCodingInc You could stop looping at half way.
Owais Ahmed
@owaisehmed
Jul 24 2017 11:44
@SweetCodingInc ok can u explain what's the difference between !== and != ?
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 11:44
You can potentially cut down loop
function pal(str){

str = str.toLowerCase().replace(/[^A-Za-z0-9]/g,'');
  var temp = str;

  for(var i = 0,j = temp.length-1; Math.ceil(i<str.length/2);i++,j--){
    if(str[i] !== temp[j])
      return false;
  }

  return true;
}

pal('eye')
@Masd925 Yeah.. was updating the code for the same
Owais Ahmed
@owaisehmed
Jul 24 2017 11:45
@SweetCodingInc yeah i know about the halfway
John Alcher
@alchermd
Jul 24 2017 11:46
Hey fellas. I have a repository containing a React app bootstrapped with create-react-app. Let's say I optimized it with npm run build. How do I make another git branch (used for production) that only contains the contents of the build folder?
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 11:46

@owaisehmed

"3" !== 3 //true
"3" != 3 // fasle

It short, it's same as == vs ===

Owais Ahmed
@owaisehmed
Jul 24 2017 11:47
!== checks the type too?
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 11:48
@owaisehmed yeah
@alchermd what branch are you on currently?
I mean name of the branch?
John Alcher
@alchermd
Jul 24 2017 11:49
@SweetCodingInc master. I would like to have a gh-pages branch that contains only the contents of the build folder.
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 11:50

In any case, I would not recommend what you're doing. But if you really want it that way, here is how you'd do it.

First create a new branch

git checkout -b prod-branch
then modify your .gitignore to ignore everything but build folder and .gitignore
*
!.gitignore
!build
then
git add .
Markus Kiili
@Masd925
Jul 24 2017 11:51
@owaisehmed It is better to stick with strict equalities === and !== that are simple to understand. If you read the abstract equality algorithms from the standard, you will agree.
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 11:52
git commit -m "deploying prod branch"

git push origin prod-branch
John Alcher
@alchermd
Jul 24 2017 11:52
@SweetCodingInc Hey man, thanks for helping out. Apparently I missed the deploying to Github Pages section in the create-react-app docs. I got it figured out now :D
CamperBot
@camperbot
Jul 24 2017 11:52
alchermd sends brownie points to @sweetcodinginc :sparkles: :thumbsup: :sparkles:
:cookie: 160 | @sweetcodinginc |http://www.freecodecamp.com/sweetcodinginc
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 11:52
@alchermd :+1:
Vikram
@vikramnr
Jul 24 2017 12:08
Hi all
Markus Kiili
@Masd925
Jul 24 2017 12:10
@vikramnr Explain the doubt.
Gus
@Guscoder
Jul 24 2017 12:54
Working on this JS problem: The variable watchList holds an array of objects with information on several movies. Use a combination of filter and map to return a new array of objects with only title and rating keys. I have filtered the objects out I want but how do I get it to only display the title and rating key/values from each object in the array? Having trouble with getting the right syntax to work. Thanks. Was trying to use arr.map to get the key/val pairs out.
Blauelf
@Blauelf
Jul 24 2017 12:57
@Guscoder You can use map, and have it return a new object, like .map(entry => ({title: entry.title, rating: entry.rating}))
Gus
@Guscoder
Jul 24 2017 13:02
Thanks, this is what I have but it is telling me the keys values are undefined. finalList = filteredList.map(function(item){
return {title: item.title, rating: item.rating};
});
@Blauelf Thanks, this is what I have but it is telling me the keys values are undefined. finalList = filteredList.map(function(item){
return {title: item.title, rating: item.rating};
});+
CamperBot
@camperbot
Jul 24 2017 13:04
guscoder sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star2: 4529 | @blauelf |http://www.freecodecamp.com/blauelf
Vikram
@vikramnr
Jul 24 2017 13:04
@Masd925 can i access collection[i].x where x=object.keys(source) like this..??
Markus Kiili
@Masd925
Jul 24 2017 13:04
@vikramnr Object.keys() returns an array of property keys.
Blauelf
@Blauelf
Jul 24 2017 13:05
@Guscoder Then what do the objects in the filteredList look like?
Vikram
@vikramnr
Jul 24 2017 13:05
@Masd925 so x[0]
Markus Kiili
@Masd925
Jul 24 2017 13:05
@vikramnr You need two nested iterations there. One through collection and one through Object.keys(source).
Gus
@Guscoder
Jul 24 2017 13:05
@Blauelf {
"Title": "Avatar",
"Year": "2009",
"Rated": "PG-13",
"Released": "18 Dec 2009",
"Runtime": "162 min",
"Genre": "Action, Adventure, Fantasy",
"Director": "James Cameron",
"Writer": "James Cameron",
"Actors": "Sam Worthington, Zoe Saldana, Sigourney Weaver, Stephen Lang",
"Plot": "A paraplegic marine dispatched to the moon Pandora on a unique mission becomes torn between following his orders and protecting the world he feels is his home.",
"Language": "English, Spanish",
"Country": "USA, UK",
"Awards": "Won 3 Oscars. Another 80 wins & 121 nominations.",
"Poster": "http://ia.media-imdb.com/images/M/MV5BMTYwOTEwNjAzMl5BMl5BanBnXkFtZTcwODc5MTUwMw@@._V1_SX300.jpg",
"Metascore": "83",
"imdbRating": "7.9",
"imdbVotes": "876,575",
"imdbID": "tt0499549",
"Type": "movie",
"Response": "True"
}
Blauelf
@Blauelf
Jul 24 2017 13:06
@Guscoder Keys in the object are Title and imdbRating, I assume?
Vikram
@vikramnr
Jul 24 2017 13:08
@Masd925 return collection[1].x[0]; // why is it undefined??
@Masd925 x[0] return the right value //last for example
Markus Kiili
@Masd925
Jul 24 2017 13:08
@vikramnr Because there is no key x on the looped object. With variables you need to use the bracket notation.
collection[1][x[0]]
Vikram
@vikramnr
Jul 24 2017 13:09
@Masd925 thanks got it
CamperBot
@camperbot
Jul 24 2017 13:09
vikramnr sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 4333 | @masd925 |http://www.freecodecamp.com/masd925
Gus
@Guscoder
Jul 24 2017 13:10
@Blauelf Thanks for your help--I wasn't entering the correct keys, or capitalizing them. Duh. I got this now and it works: filteredList = firstList.map(function(item){
return {title: item.Title, rating: item.imdbRating};
});
CamperBot
@camperbot
Jul 24 2017 13:10
guscoder sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:warning: guscoder already gave blauelf points
Blauelf
@Blauelf
Jul 24 2017 13:10
@Guscoder :+1:
Ragnorak
@Rrak
Jul 24 2017 13:17
This project is still incomplete, but wanted to check whether the API call is working fine to everyone. Please help!!
https://s.codepen.io/Ragnorok/debug/dzbEqq/NQMzYnZWyXgk
Joel Y.
@zapcannon99
Jul 24 2017 13:20

Interesting icon for mist. I guess it's a mist icon?

Api seems fine otherwise.

Ragnorak
@Rrak
Jul 24 2017 13:21
Still icon has not been configured to show relative to your current weather, just kept default one for start
Joel Y.
@zapcannon99
Jul 24 2017 13:21
ah, ok, makes sense
Ragnorak
@Rrak
Jul 24 2017 13:22
thanks @zapcannon99
CamperBot
@camperbot
Jul 24 2017 13:22
rrak sends brownie points to @zapcannon99 :sparkles: :thumbsup: :sparkles:
:cookie: 313 | @zapcannon99 |http://www.freecodecamp.com/zapcannon99
Joel Y.
@zapcannon99
Jul 24 2017 13:22
np
Stephen James
@sjames1958gm
Jul 24 2017 13:31
@Rrak Shows the weather for my location
Ghulam Shabir
@ghulamshabir
Jul 24 2017 13:33
@Rrak location is not exact
Vikram
@vikramnr
Jul 24 2017 13:38
If I have conditions like this to check how should I go ahead in implementing this?? if(collection[i][x[0]]===y[0]&&collection[i][x[1]]===y[1])if(collection[i][x[0]]===y[0]&&collection[i][x[1]]===y[1])
where i is zero to three
@Rrak shows exact location for me :+1:
Markus Kiili
@Masd925
Jul 24 2017 13:39
@vikramnr You need a nested loop (or iteration) through Object.keys(source).
You also need some loop logic so you keep those looped objects that have matching property values with source for all the source's keys.
Vikram
@vikramnr
Jul 24 2017 13:41
@Masd925 i think all is key thing I'm missing if I go ahead by implementing like y[j] where y is array from Object.values(source)
Markus Kiili
@Masd925
Jul 24 2017 13:42
@vikramnr Array of values is of no use here.
@vikramnr A loop solution needs two nested loops through arrays collection and Object.keys(source).
Vikram
@vikramnr
Jul 24 2017 13:44
@Masd925 If take into account of object.keys(source) then how I'll be missing the check that they contain the same value
Markus Kiili
@Masd925
Jul 24 2017 13:46
@vikramnr You need to check if the property values of collection[i] and source match for the looped source key. You need some logic so you only keep the looped object if the condition holds for all the source's keys. You can use a flag variable.
So the condition needs to be true for all the values of the inner loop.
Vikram
@vikramnr
Jul 24 2017 13:48
@Masd925 if(collection[i].hasOwnProperty(x[j])) like this ??
where x is of array from object.keys(source)
Kelechi Chinaka
@ke1echi
Jul 24 2017 13:51
need to remove duplicate
[1,2,3,2,4,6,2,6,7] => [1,3,4,7]
Markus Kiili
@Masd925
Jul 24 2017 13:51
@vikramnr You also need to compare === the property values.
@kelechy Filter method is a friend.
Ragnorak
@Rrak
Jul 24 2017 13:52
thank @sjames1958gm
CamperBot
@camperbot
Jul 24 2017 13:52
rrak sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
Kelechi Chinaka
@ke1echi
Jul 24 2017 13:52
i dont know how to go bout the logic
CamperBot
@camperbot
Jul 24 2017 13:52
:star2: 8144 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Ragnorak
@Rrak
Jul 24 2017 13:52
thanks @vikramnr
CamperBot
@camperbot
Jul 24 2017 13:52
rrak sends brownie points to @vikramnr :sparkles: :thumbsup: :sparkles:
:cookie: 320 | @vikramnr |http://www.freecodecamp.com/vikramnr
Markus Kiili
@Masd925
Jul 24 2017 13:52
@kelechy For first instances of a particular number, the index and what indexOf returns are the same.
For repeating numbers they are not the same.
Ragnorak
@Rrak
Jul 24 2017 13:53
@ghulamshabir Please tell me what is your location and what you got! thanks
CamperBot
@camperbot
Jul 24 2017 13:53
rrak sends brownie points to @ghulamshabir :sparkles: :thumbsup: :sparkles:
:star2: 1924 | @ghulamshabir |http://www.freecodecamp.com/ghulamshabir
Markus Kiili
@Masd925
Jul 24 2017 13:54
@kelechy So you can use index===array.indexOf(elem) as the condition on filter.
Vikram
@vikramnr
Jul 24 2017 13:54
@Masd925 Thanks for helping out.. I'll try
CamperBot
@camperbot
Jul 24 2017 13:54
vikramnr sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:warning: vikramnr already gave masd925 points
Diego Mayer
@Chrono79
Jul 24 2017 14:50
@kelechy for what you wrote there you should use indexOf and lastIndexOf instead
Markus Kiili
@Masd925
Jul 24 2017 14:52
@Chrono79 Yeah, I misread the arrays in the message.
Diego Mayer
@Chrono79
Jul 24 2017 14:52
:+1:
Jason Luboff
@JLuboff
Jul 24 2017 15:27
:wave: all
Markus Kiili
@Masd925
Jul 24 2017 15:28
@JLuboff Yo.
Jason Luboff
@JLuboff
Jul 24 2017 15:28
What up?
Markus Kiili
@Masd925
Jul 24 2017 15:29
@JLuboff Figuring out whether you really can/cannot refer to an anonymous function within itself.
Jason Luboff
@JLuboff
Jul 24 2017 15:29
Mmmhm..
Markus Kiili
@Masd925
Jul 24 2017 15:32
@JLuboff You kind of can by using bind and this, but then again it is not really the same function because bind makes another function and sets the value of this. So yes and no.
-> yeno
Jason Luboff
@JLuboff
Jul 24 2017 15:32
Yano?
kumquatfelafel
@kumquatfelafel
Jul 24 2017 15:33
noes? That seems the most clear.
Markus Kiili
@Masd925
Jul 24 2017 15:35
@kumquatfelafel I think SQL people would add noes to the language without a problem. true, false, null, noes would solve many problems that just null has.
kumquatfelafel
@kumquatfelafel
Jul 24 2017 15:36
SELECT GOO FROM NOES? :o
... It could work!
Kelechi Chinaka
@ke1echi
Jul 24 2017 15:51
yea..exactly what i used @Chrono79 :+1:
Bradley Sands
@sandsbe
Jul 24 2017 16:02
  var usersUrl =
      "https://wind-bow.gomix.me/twitch-api/users/"+fullList[i]+"?callback=?";
  for (i = 0; i < fullList.length; i++) {
    (function(i){
    $.getJSON(usersUrl, function(data) {
        console.log(fullList[i]);
        console.log(usersUrl);
        console.log(i);
        displayName.push(data.display_name);
getting undefined in my console.log(usersUrl). No idea why.
Bradley Sands
@sandsbe
Jul 24 2017 16:09
console.log(fullList[i]) works and console.log(i) works
alpox
@alpox
Jul 24 2017 16:24
@sandsbe i believe though, that it is the log of fullList which doesnt work though
Bradley Sands
@sandsbe
Jul 24 2017 16:35
@alpox I moved the var usersUrl into the for loop and it worked then.
Not sure why that is a scoping issue there.
Jason Luboff
@JLuboff
Jul 24 2017 16:38
@sandsbe You can't have the url outside your loop when you're requiring the i variable from the loop (at least I don't see that working)
Nick Janne
@njanne19
Jul 24 2017 16:44
Is there any way I can reduce input lag on my roguelike game?
Joseph
@revisualize
Jul 24 2017 16:52
reduce lag?
What the hell are you doing?
@njanne19
about @njanne19
CamperBot
@camperbot
Jul 24 2017 16:53
:cookie: 335 | @njanne19 |http://www.freecodecamp.com/njanne19
Jason Luboff
@JLuboff
Jul 24 2017 16:55
@revisualize Hows the arm?
Joseph
@revisualize
Jul 24 2017 16:55
@JLuboff Broken. LOL.
Nick Janne
@njanne19
Jul 24 2017 16:55
@revisualize https://codepen.io/njanne19/pen/WOPVZj?editors=0011 take a look for yourself
there's just some input lag every few moves that I wanna get rid of
Joseph
@revisualize
Jul 24 2017 16:56
@njanne19
image.png
@njanne19 What game?
Google Chrome (updated) Windows 10 Ent.
Nick Janne
@njanne19
Jul 24 2017 16:57
@revisualize sorry, I'm working on stuff so the games not there this second give me a sed
Conor Murphy
@cmurphy580
Jul 24 2017 17:00
if (transcript.includes('open Gmail')) {
        window.open('https://www.gmail.com',"_blank")
    }
i have this bit of code. When it runs it opens three windows. Does anyone know how to fix this problem?
Joseph
@revisualize
Jul 24 2017 17:00
@njanne19 Note: I was looking over your projects ... I saw that you put zip files on Github. ... If I was looking at your resume and projects and saw that I had to download a zip to see your code. .... I'd stop looking at you as a candidate.
Nick Janne
@njanne19
Jul 24 2017 17:03
@revisualize Now it's functional, for some reason, my getRAP method is having issues
and I know I need to do a lot to clean up my resume and projects, I'm still in high school so I don't really worry about getting hired right now
Joseph
@revisualize
Jul 24 2017 17:05
@njanne19 Okay. I assumed. But, just a heads up. (Note: I know HS students making at least 1000.00 a week writing code. So... There is that.)
But, I need to go AFK. (work)
Nick Janne
@njanne19
Jul 24 2017 17:06
Well s* I wish I could
odm275
@odm275
Jul 24 2017 17:06
Why does jquery load before any of my other code
it is messing thing up :S
Nick Janne
@njanne19
Jul 24 2017 17:06
@odm275 send what you have!
Most likely it's the
$(document).ready(function() {
);
Conor Murphy
@cmurphy580
Jul 24 2017 17:08
if (transcript.includes('open Gmail')) {
        window.open('https://www.gmail.com',"_blank")
    }
i have this bit of code. When it runs it opens three windows. Does anyone know how to fix this problem?
Nick Janne
@njanne19
Jul 24 2017 17:09
@cmurphy580 what is your transcript variable
odm275
@odm275
Jul 24 2017 17:09
@njanne19 when should i use and not use ().ready?
Nick Janne
@njanne19
Jul 24 2017 17:09
The _blank tells it to open a new window, I assume you know that, but if you have "open Gmail" multiple times somewhere by accident...
@cmurphy580 anything inside the ready function will be completed first
Conor Murphy
@cmurphy580
Jul 24 2017 17:10
speech recognition converted to text
recognition.addEventListener("result", event => {
  console.log(event);
  const transcript = [...event.results]
    .map(result => result[0])
    .map(result => result.transcript)
    .join("");

  p.textContent = transcript;

  if (event.results[0].isFinal) {
    p = document.createElement("p");
    words.appendChild(p);
  }
  if (transcript.includes('open Gmail')) {
        window.open('https://www.gmail.com','_blank')
    }
});
@njanne19
Don't have it else anywhere but maybe just because its going from speech to text
Nick Janne
@njanne19
Jul 24 2017 17:12
@cmurphy580 while I don't see your bug at face value, I'd try breaking up your dot notation when defining your transcript constant, try console logging somethings to see where your function gets stuck
Conor Murphy
@cmurphy580
Jul 24 2017 17:13
alright i'll give it a look thanks for checking it out
@njanne19 thank you
CamperBot
@camperbot
Jul 24 2017 17:13
cmurphy580 sends brownie points to @njanne19 :sparkles: :thumbsup: :sparkles:
:cookie: 336 | @njanne19 |http://www.freecodecamp.com/njanne19
Nick Janne
@njanne19
Jul 24 2017 17:19
no problem
Bradley Sands
@sandsbe
Jul 24 2017 17:33
@JLuboff > @sandsbe You can't have the url outside your loop when you're requiring the i variable from the loop (at least I don't see that working)
Why not?
Jason Luboff
@JLuboff
Jul 24 2017 17:35
@sandsbe I mean..it might work if you initially declare i outside your loop (and above URL)
Bradley Sands
@sandsbe
Jul 24 2017 17:38
Ok. I thought I tried that at one point but I've ripped this JS to shred a few times.
Nick Janne
@njanne19
Jul 24 2017 17:38
still not understanding why my getRAP method is finding undefined values https://codepen.io/njanne19/pen/WOPVZj
Joseph
@revisualize
Jul 24 2017 17:54
@njanne19 I don't see the lag that you were referencing.
Nick Janne
@njanne19
Jul 24 2017 17:58
@revisualize every 3 -5 steps, the blue player skips. Additionally, in chrome console, I get an "cannot read property of undefined at getRAP()"
Stephen James
@sjames1958gm
Jul 24 2017 18:03
@njanne19 Why Math.round in getRAP? Do you want values from 0-100 or 0-99?
Bradley Sands
@sandsbe
Jul 24 2017 18:03
Not sure if anyone has seen it but you can get free 3-month access to PluralSight if you sign up for a free Microsoft Visual Studies account. NOT an advertisement. It was something that was pointed out in another forum (www.indiehackers.com), I'm definitely intrigued and plan on finishing fCC in conjunction with some PluralSight tracks.
Nick Janne
@njanne19
Jul 24 2017 18:04
@sjames 0-100
Joseph
@revisualize
Jul 24 2017 18:04
@njanne19 isn't this.state in consructor?
Nick Janne
@njanne19
Jul 24 2017 18:04
@revisualize it is in constructor?
Isn't it?
Joseph
@revisualize
Jul 24 2017 18:05
@njanne19 IDK ... should it be this.constructor.state.map
Nick Janne
@njanne19
Jul 24 2017 18:06
I don't think so... I've been using dot notation without using constructor for all of my react projects thus far
Joseph
@revisualize
Jul 24 2017 18:06
I don't know React
Anyhow. 1115am meeting
Stephen James
@sjames1958gm
Jul 24 2017 18:10
@njanne19 Why do you want 0-100 from getRAP when your arrays are only 100 in size.
Nick Janne
@njanne19
Jul 24 2017 18:11
@sjames1958gm because I want an x value from 0-100?
Oh I see what you mea
Stephen James
@sjames1958gm
Jul 24 2017 18:12
@njanne19 But your array is only 0-99 - you get that error when randomY is 100
Nick Janne
@njanne19
Jul 24 2017 18:12
Right right
Much better now! Thanks as always @sjames1958gm
CamperBot
@camperbot
Jul 24 2017 18:13
njanne19 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8147 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Jul 24 2017 18:13
@njanne19 :+1:
Nick Janne
@njanne19
Jul 24 2017 18:14
What is your profile pic on github
Stephen James
@sjames1958gm
Jul 24 2017 18:17
One of my favorite actors Toshiro Mifune
Joseph
@revisualize
Jul 24 2017 18:29
@njanne19 Why in your game does it have me drop the stronger weapon and pick up a weaker one?
Nick Janne
@njanne19
Jul 24 2017 18:30
You have to be wise! You can take a gamble on possibly getting a better weapon like a machine gun, or you could get a stick
Joseph
@revisualize
Jul 24 2017 18:30
@njanne19 f that.
Nick Janne
@njanne19
Jul 24 2017 18:30
lol
Pieter Stokkink
@forkerino
Jul 24 2017 18:32
:wave:
Joseph
@revisualize
Jul 24 2017 18:32
@njanne19 How do you win?
Nick Janne
@njanne19
Jul 24 2017 18:32
Not finished yet
Jason Luboff
@JLuboff
Jul 24 2017 18:32
@forkerino :wave:
Nick Janne
@njanne19
Jul 24 2017 18:32
but you gotta beat the boss which I haven't added yet
Joseph
@revisualize
Jul 24 2017 18:33
@njanne19 ahh.. Ok.
:D
Pieter Stokkink
@forkerino
Jul 24 2017 18:33
@JLuboff how's things?
Jason Luboff
@JLuboff
Jul 24 2017 18:33
@forkerino Eh...Okay.. You?
Joseph
@revisualize
Jul 24 2017 18:33
@njanne19 I want to create a text based adventure.
Tom
@moT01
Jul 24 2017 18:34
anyone know when the beta might come out?
Joseph
@revisualize
Jul 24 2017 18:34
@moT01 I heard November.
Ronique Ricketts
@RoniqueRicketts
Jul 24 2017 18:34
@moT01 I heard November idk how true it is
Nick Janne
@njanne19
Jul 24 2017 18:34
Have you seen this @revisualize http://www.asciimation.co.nz/
Pieter Stokkink
@forkerino
Jul 24 2017 18:34
@JLuboff good, had a great weekend.
Tom
@moT01
Jul 24 2017 18:34
thanks @RoniqueRicketts @revisualize , so probly november at the earliest then?
Joseph
@revisualize
Jul 24 2017 18:34
@njanne19 That doesn't work for what I want to create.
CamperBot
@camperbot
Jul 24 2017 18:34
mot01 sends brownie points to @roniquericketts and @revisualize :sparkles: :thumbsup: :sparkles:
:cookie: 306 | @roniquericketts |http://www.freecodecamp.com/roniquericketts
:star2: 4377 | @revisualize |http://www.freecodecamp.com/revisualize
Jason Luboff
@JLuboff
Jul 24 2017 18:35
@forkerino Awesome, do something special?
Pieter Stokkink
@forkerino
Jul 24 2017 18:35
@JLuboff met a lot of old friends
Ronique Ricketts
@RoniqueRicketts
Jul 24 2017 18:35
@moT01 I hope they do
Joseph
@revisualize
Jul 24 2017 18:36
@njanne19 For what I want to make... There can't be all that ascii art.
Jason Luboff
@JLuboff
Jul 24 2017 18:36
@forkerino Nice
Tom
@moT01
Jul 24 2017 18:36
well, im about to start the dynamic backend projects, so im trying to figure out if ill have time to finish
Pieter Stokkink
@forkerino
Jul 24 2017 18:36
Yeah, it was revitalizing.
Nick Janne
@njanne19
Jul 24 2017 18:37
@moT01 I'm planning on doing all the projects FCC has now, then go back for all the new certificates
Joseph
@revisualize
Jul 24 2017 18:37
I wonder...
Tom
@moT01
Jul 24 2017 18:37
but if the beta comes out now, im pretty sure your current progress will go away, and only the certs youve earned will stay
Joseph
@revisualize
Jul 24 2017 18:39
@moT01 Incorrect.
Nick Janne
@njanne19
Jul 24 2017 18:39
@moT01 Quincy did an AMA about it a while ago and I'm pretty sure he said that wouldn't happen
Joseph
@revisualize
Jul 24 2017 18:39
@moT01 Your current progress on LIVE stays.
@moT01 Anything that you do on BETA is GONE.
@moT01 All of your LIVE certs stay.
@moT01 Nothing done on the beta will be migrated. It will be LOST.
Tom
@moT01
Jul 24 2017 18:42
k, yea, the certs stay, but the projects im talking about are the last 4 or 5 on the backend, that dont exist in the beta. Will those be integrated in there, or what will happen if i get to the last one - then the beta comes out
Joseph
@revisualize
Jul 24 2017 18:44
@moT01 You completed them?
Tom
@moT01
Jul 24 2017 18:44
no, i am about to start them
Joseph
@revisualize
Jul 24 2017 18:44
If yes. Stay.
Tom
@moT01
Jul 24 2017 18:44
im on the voting app
Joseph
@revisualize
Jul 24 2017 18:45
Anything that you complete before beta push. Stays.
That's what I've been told.
Further questoins.
They can answer ALL of your questions in there. :D
Tom
@moT01
Jul 24 2017 18:46
yes, i asked in there, nobody responded yet, and i know some of you guys in here know a lot
Joseph
@revisualize
Jul 24 2017 18:46
@moT01 Look, I have completed challenges that aren't live any more.
They've stayed on my profile.
If you try to view the challenge solution it errors out.
But, the projects shouldn't be reliant on your freeCodeCamp portfolio.
They should be all on your github.
The link to your project solutions outside of freeCodeCamp should all work.
Tom
@moT01
Jul 24 2017 18:49
yes, they are on my local and github
let me ask one more question
will i still be able to get the backend cert once the beta comes out
Jason Luboff
@JLuboff
Jul 24 2017 18:50
Backend cert won
't exist
They're changing all the certs
Tom
@moT01
Jul 24 2017 18:50
alright
thanks everyone @JLuboff @njanne19 - i think i got it figured out
CamperBot
@camperbot
Jul 24 2017 18:52
mot01 sends brownie points to @jluboff and @njanne19 :sparkles: :thumbsup: :sparkles:
:cookie: 337 | @njanne19 |http://www.freecodecamp.com/njanne19
:star2: 2095 | @jluboff |http://www.freecodecamp.com/jluboff
Seth
@sethdcd
Jul 24 2017 19:02
hello, can someone please help, i created an infinite loop in one of my challenges so now anytime i go to freecodecamp.com the site just crashes :(
Ogundele Olumide
@Lumexralph
Jul 24 2017 19:04
Hello Everyone :wave:
kumquatfelafel
@kumquatfelafel
Jul 24 2017 19:05
@sethdcd see "recovering unresponsive code" section
Conor Murphy
@cmurphy580
Jul 24 2017 19:08
Need a little here with my open.window() command. I say 'open Amazon' and three tabs are opened instead of just one. any ideas? Here it is in codepen.
https://codepen.io/cmurphy580/pen/rzNyNo?editors=1010
Nick Janne
@njanne19
Jul 24 2017 19:08
Anybody know if there is a way to run .java files with atom and get console output
Kelechi Chinaka
@ke1echi
Jul 24 2017 19:08
:wave: @Lumexralph
a friend of mine got the bootcamp msg, hope u got too @Lumexralph
Ogundele Olumide
@Lumexralph
Jul 24 2017 19:11
@njanne19 Java or JS ?
@kelechy Yes oo.... i did
Seth
@sethdcd
Jul 24 2017 19:11
@kumquatfelafel thanks!
CamperBot
@camperbot
Jul 24 2017 19:11
sethdcd sends brownie points to @kumquatfelafel :sparkles: :thumbsup: :sparkles:
:cookie: 531 | @kumquatfelafel |http://www.freecodecamp.com/kumquatfelafel
Ogundele Olumide
@Lumexralph
Jul 24 2017 19:12
@kelechy good evening, another battle..... sighs
Nick Janne
@njanne19
Jul 24 2017 19:12
@Lumexralph Java
Like something where I can see my System.outs and stuff
Ogundele Olumide
@Lumexralph
Jul 24 2017 19:20
@njanne19 I don't know about Java but it'll have its I/O
kumquatfelafel
@kumquatfelafel
Jul 24 2017 19:22
@njanne19 are you having a problem with a java file?
or want to display/see what is going on?
Kelechi Chinaka
@ke1echi
Jul 24 2017 19:25
:smile: congrats @Lumexralph
this battle must be won @Lumexralph :smile:
Ogundele Olumide
@Lumexralph
Jul 24 2017 19:30
@kelechy bro, i'll try. seems those guys are asking too much
Kelechi Chinaka
@ke1echi
Jul 24 2017 19:33
what? @Lumexralph
Nick Janne
@njanne19
Jul 24 2017 19:33
@kumquatfelafel No, I'm taking a java summer course and so far we've been using Dr.Java. I like atom a lot more...
kumquatfelafel
@kumquatfelafel
Jul 24 2017 19:41

@njanne19 just trying to clarify your problem a bit...

Is issue when you say something like

   System.out.println("Hello World");

you can't find the console where this appears, or is the problem you're having something else?

Nick Janne
@njanne19
Jul 24 2017 19:42
@kumquatfelafel no I'm not having problems I was just wondering if atom supports a console for running java files
Ogundele Olumide
@Lumexralph
Jul 24 2017 19:42
@kelechy fullstack
Bradley Sands
@sandsbe
Jul 24 2017 19:43
Any reason why my <p> tag in Codepen is huge? Went into CSS and changed it to font-size:14px but the default should be 14px http://getbootstrap.com/css/. Anyone else have this issue?
kumquatfelafel
@kumquatfelafel
Jul 24 2017 19:43
@njanne19 i'd recommend using an IDE like Eclipse or IntelliJ.
Kelechi Chinaka
@ke1echi
Jul 24 2017 19:43
lol @Lumexralph
kumquatfelafel
@kumquatfelafel
Jul 24 2017 19:43
@njanne19 though unsure because unfamiliar with running java files on atom
Ogundele Olumide
@Lumexralph
Jul 24 2017 19:44
@kelechy abi
Kelechi Chinaka
@ke1echi
Jul 24 2017 19:45
where are u learning node @Lumexralph
where did they specify that they need fullstack @Lumexralph
in the email? @Lumexralph
Ogundele Olumide
@Lumexralph
Jul 24 2017 19:47
@kelechy from Udemy
Kelechi Chinaka
@ke1echi
Jul 24 2017 19:47
ok @Lumexralph
Ogundele Olumide
@Lumexralph
Jul 24 2017 19:47
@kelechy that's what all the guys I discussed with told me
Kelechi Chinaka
@ke1echi
Jul 24 2017 19:48
nawa o @Lumexralph
free or paid? @Lumexralph
kumquatfelafel
@kumquatfelafel
Jul 24 2017 19:49
@njanne19 From what google tells me, atom is capable of being used to edit java code, but is not capable of compiling/executing it.
kumquatfelafel
@kumquatfelafel
Jul 24 2017 19:54
And assuming you've already downloaded jdk, but in case haven't yet... http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
kumquatfelafel
@kumquatfelafel
Jul 24 2017 20:09
@njanne19 though yeah, if what you need for atom is anywhere, then it will be here. https://atom.io/packages/search?q=java
dyon3334
@dyon3334
Jul 24 2017 20:36
javascript: switch vs if ?
Jason Luboff
@JLuboff
Jul 24 2017 20:37
From what I've read from actual developers...most rarely use switches
aRtoo
@artoodeeto
Jul 24 2017 20:46
hi guys do you really need API key for twitch? the documentation is different now.
makalohri
@makalohri
Jul 24 2017 20:47
@knrt10 thanks man
CamperBot
@camperbot
Jul 24 2017 20:47
makalohri sends brownie points to @knrt10 :sparkles: :thumbsup: :sparkles:
:cookie: 467 | @knrt10 |http://www.freecodecamp.com/knrt10
Jason Luboff
@JLuboff
Jul 24 2017 20:48
@artoodeeto For the actual API, yes. If using the FCC work around, no
alpox
@alpox
Jul 24 2017 20:48
@artoodeeto And for the actual API reference: https://dev.twitch.tv/docs/v5/guides/using-the-twitch-api
Jason Luboff
@JLuboff
Jul 24 2017 20:49
I don't get why they even made the work around..
I just got a ClientID and mine worked fine..
alpox
@alpox
Jul 24 2017 20:49
@JLuboff because FCC tries to tell that one shouldn't expose an API key/ClientID in any open source code
Jason Luboff
@JLuboff
Jul 24 2017 20:50
@alpox Ah...thats true..
While I get for production code you wouldn't want to do that...for something like this.. its not a big deal
aRtoo
@artoodeeto
Jul 24 2017 20:51
@JLuboff this work around?? https://wind-bow.gomix.me/twitch-api??
Jason Luboff
@JLuboff
Jul 24 2017 20:52
Yes
aRtoo
@artoodeeto
Jul 24 2017 20:52
@JLuboff tried putting a username and its not working anymore
kumquatfelafel
@kumquatfelafel
Jul 24 2017 20:53
@dyon3334 I sometimes use switch statements when the conditions are relatively simple, yet don't have enough of a logical relation to one another that they're conducive to a readable if-else chain. You could more or less use them interchangeably if you wanted though.
Jason Luboff
@JLuboff
Jul 24 2017 20:53
@artoodeeto Did you put it in properly? There's a note here: https://wind-bow.glitch.me/
aRtoo
@artoodeeto
Jul 24 2017 20:55
@JLuboff yea. server error still
Jason Luboff
@JLuboff
Jul 24 2017 20:56
Ok..what url are you actually trying to use?
Nadia
@nadiaschutz
Jul 24 2017 21:00
hi guys
Morchid Chellali
@Morched23MJ
Jul 24 2017 21:02
hi
Michiel
@MichielHuijse
Jul 24 2017 21:02
@nadiaschutz Hello
Nadia
@nadiaschutz
Jul 24 2017 21:04
//any ideas why the string of the city is not loaded when it's out of the function weatherAsk?

var weather;
var api = "http://api.openweathermap.org/data/2.5/weather?q=";
var apiKey = "&appid=001b0f58045147663b1ea518d34d88b4&";
var units = "units=metric";
var city = document.getElementById("city").value;

function setup() {
    createCanvas(400, 200);
    document.getElementById("submit").addEventListener("click", weatherAsk);
}

function weatherAsk() {

    var url = api + city + apiKey + units;
    loadJSON(url, gotData);
}

function gotData(data) {
    weather = data;

}

function draw() {
    background(0);
    if (weather) {
        var temp = weather.main.temp;
        var temp_min = weather.main.temp_min;
        ellipse(50, 100, temp, temp);
        ellipse(300, 100, temp_min, temp_min);
    }
}
Pieter Stokkink
@forkerino
Jul 24 2017 21:05
@dyon3334 I only use switch when I use Redux (inside the reducer function), because it is convention. Other than that I use if/else, or if there are many different cases, something like a lookup object can make a lot of sense.
Nadia
@nadiaschutz
Jul 24 2017 21:06
//when i put var city into weatherAsk, everything works..

var weather;
var api = "http://api.openweathermap.org/data/2.5/weather?q=";
var apiKey = "&appid=001b0f58045147663b1ea518d34d88b4&";
var units = "units=metric";
var city;

function setup() {
    createCanvas(400, 200);
    document.getElementById("submit").addEventListener("click", weatherAsk);
}

function weatherAsk() {
    city = document.getElementById("city").value;
    var url = api + city + apiKey + units;
    loadJSON(url, gotData);
}

function gotData(data) {
    weather = data;

}

function draw() {
    background(0);
    if (weather) {
        var temp = weather.main.temp;
        var temp_min = weather.main.temp_min;
        ellipse(50, 100, temp, temp);
        ellipse(300, 100, temp_min, temp_min);
    }
}
Jason Luboff
@JLuboff
Jul 24 2017 21:06
@forkerino You seem to just be lurking in the background like me :joy:
Pieter Stokkink
@forkerino
Jul 24 2017 21:06
@JLuboff I was just finishing up some work.
in the background
code reviews
Jason Luboff
@JLuboff
Jul 24 2017 21:06
Ah.
I should get in there and start practicing with that...but so much other stuff
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:09
hello everyone
just a little question
Michiel
@MichielHuijse
Jul 24 2017 21:09
@nadiaschutz good question, that is something I am also trying to understand. :) I also think it should act as a global value.
Pieter Stokkink
@forkerino
Jul 24 2017 21:09
@JLuboff It's fun, but I'm a bit too tired to do it properly at the moment. 11 pm here.
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:09
if I do somethong like array.slice(0,1)
it goes to position 1 and slice 1 element right?
Nadia
@nadiaschutz
Jul 24 2017 21:10
@MichielHuijse that what i know....any function takes var value from global...wtf going on with my var city?
@MichielHuijse besides ...when i put var city into function setup()....it also doesn't work
Pieter Stokkink
@forkerino
Jul 24 2017 21:11
@nadiaschutz in the top code, city will contain the value in the DOM element when it has just loaded.
I'm assuming someone puts in their city to find it?
Nadia
@nadiaschutz
Jul 24 2017 21:11
yep
Pieter Stokkink
@forkerino
Jul 24 2017 21:11
@nadiaschutz so it is probably empty in the beginning
Jason Luboff
@JLuboff
Jul 24 2017 21:11
@forkerino Ya, I'm normally sleeping by 11
kumquatfelafel
@kumquatfelafel
Jul 24 2017 21:12
@nadiaschutz you can put the rest inside your weather ask or pass the value to function as argument. Or return it
Pieter Stokkink
@forkerino
Jul 24 2017 21:12
@JLuboff lately I've been trying to sleep at 11, but unsuccessfully
midnight seems to be the sweet spot for me.
Nadia
@nadiaschutz
Jul 24 2017 21:13
@forkerino thanks...i got you
CamperBot
@camperbot
Jul 24 2017 21:13
nadiaschutz sends brownie points to @forkerino :sparkles: :thumbsup: :sparkles:
:star2: 2890 | @forkerino |http://www.freecodecamp.com/forkerino
Pieter Stokkink
@forkerino
Jul 24 2017 21:13
@nadiaschutz :+1:
@tiagocorreiaalmeida first arg is the starting pos, second the ending pos, so it would take the 0'th element of the array
kumquatfelafel
@kumquatfelafel
Jul 24 2017 21:17
slice (startsAtThisElement, endsBeforeThisElement)
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:18
@hey forkerino :D im writing such a strange code but trying to make it work in the ned xd
end
Jason Luboff
@JLuboff
Jul 24 2017 21:18
@forkerino I've had to train myself to go to bed by 10:30. Weekends is usually later but not by much
Pieter Stokkink
@forkerino
Jul 24 2017 21:18
@tiagocorreiaalmeida I make that typo all the time. I have to type 'frontend' a lot
@JLuboff I go overboard on weekends. And I'm not even doing anything like partying or drinking, but before I know it, it is 3 am.
Jason Luboff
@JLuboff
Jul 24 2017 21:19
Ya...unless we're out with friends...I'm still in bed usually by 11:30 lol
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:19
nedstark = the problem
@forkerino shouldnt something like this work
function pairwise(arr, arg) {
  return arr.reduce(function(acc, obj,index, array){ 
    var arraytobechecked = arr;
    arraytobechecked.slice(array[index],1);
Pieter Stokkink
@forkerino
Jul 24 2017 21:20
who is endstark?
Jason Luboff
@JLuboff
Jul 24 2017 21:20
ned stark is dead though..
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:20
revive
call the fire girl
kumquatfelafel
@kumquatfelafel
Jul 24 2017 21:20
I find it very easy to be awake until 5 or 6 am on weekends
Pieter Stokkink
@forkerino
Jul 24 2017 21:20
@tiagocorreiaalmeida .slice returns a new array, it doesn't change the array you call it on
@kumquatfelafel looking at the bright side
:+1:
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:21
but I want to keep the same array I just wanna slice the value that reduce is going on that moment
Michiel
@MichielHuijse
Jul 24 2017 21:21
Why is my capital letter function not working?
function myReplace(str, before, after) {

  function capitalizeFirstLetter(after) {
    return after.charAt(0).toUpperCase() + after.slice(1);
    // Capitalizes the first character of the string after and returns after.
}

  if (before[0] === before[0].toUpperCase()) {
    // Checks wether the before strin has an uppercase.

    capitalizeFirstLetter(after);

    console.log(after);
    // invokes function.

  }

  str = str.replace(before, after);
  // Replaces the

  return str;
}

myReplace("He is Sleeping on the couch", "Sleeping", "sitting");
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:21
like I have 1 2 3 4 5 as array
reduce method is going on the 5 number
I wanna slice (4,1)
and keep the rest
kumquatfelafel
@kumquatfelafel
Jul 24 2017 21:22
@tiagocorreiaalmeida if you want to keep the same array, then don't use slice.
Pieter Stokkink
@forkerino
Jul 24 2017 21:22
@tiagocorreiaalmeida 1 isn't the length, it is the ending position
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:23
so 4,4?
Pieter Stokkink
@forkerino
Jul 24 2017 21:23
@MichielHuijse you don't store the return value anywhere
@tiagocorreiaalmeida 4,4 would not slice out anything
4,5 would
but what do you want to do with that value?
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:23
but since array only has position unthil number 4 since it starts at 0?
sorry confusing
I wanna check a array
beside the value
that im reading at the moment
Michiel
@MichielHuijse
Jul 24 2017 21:24
@forkerino aah ok
@forkerino thanks
CamperBot
@camperbot
Jul 24 2017 21:24
michielhuijse sends brownie points to @forkerino :sparkles: :thumbsup: :sparkles:
:star2: 2891 | @forkerino |http://www.freecodecamp.com/forkerino
Pieter Stokkink
@forkerino
Jul 24 2017 21:25
:+1:
kumquatfelafel
@kumquatfelafel
Jul 24 2017 21:25
nvm
Conor Murphy
@cmurphy580
Jul 24 2017 21:25
hey i have this basic speech recognition app that when you say open gmail it should open a new tab with the email but instead it opens 3 or 4 tabs. I think this might be happening because of where the particular conditionals sit, but was wondering you all had any thoughts?
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:25
np @kumquatfelafel you got my idea?is any easier way to do it?
I wanna check a array of values
Pieter Stokkink
@forkerino
Jul 24 2017 21:26
@tiagocorreiaalmeida .filter makes more sense, I think
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:26
I see but is there anyway to do what I wanted to do?just wanna finish what I tought and then I always give a look at some tutorials to see how I could have done it eheh
Pieter Stokkink
@forkerino
Jul 24 2017 21:27
@tiagocorreiaalmeida you want an array without the current element in it?
kumquatfelafel
@kumquatfelafel
Jul 24 2017 21:27
@tiagocorreiaalmeida what you want to do is remove a given value while modifying the original array?
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:27
@forkerino that's it
@kumquatfelafel yueah I create a temporary array
Pieter Stokkink
@forkerino
Jul 24 2017 21:29
@tiagocorreiaalmeida arr.slice(0, index).concat(arr.slice(index+1)) if you insist on using slice.
this will give an array without the element at index.
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:29
confusing code for me can you give me a little explanation?and srry for wasting time
strange didnt work
still game same values in the return
nm
my bad :D
kumquatfelafel
@kumquatfelafel
Jul 24 2017 21:31
You could also use splice. You could also use copyWithin + pop if you wanted to get really weird. :p
There are number of ways to perform this action.
Pieter Stokkink
@forkerino
Jul 24 2017 21:31
@tiagocorreiaalmeida the first slice gives stuff from the beginning up to index, the second from index+1 to the end. It concats them.
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:32
aaaaa you are the master of this :D how's the job going?
thanks @forkerino and @kumquatfelafel
CamperBot
@camperbot
Jul 24 2017 21:32
tiagocorreiaalmeida sends brownie points to @forkerino and @kumquatfelafel :sparkles: :thumbsup: :sparkles:
:cookie: 532 | @kumquatfelafel |http://www.freecodecamp.com/kumquatfelafel
:star2: 2892 | @forkerino |http://www.freecodecamp.com/forkerino
Pieter Stokkink
@forkerino
Jul 24 2017 21:32
@tiagocorreiaalmeida good! It is a lot of fun.
I think I'm getting the hang of this coding thing.
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:33
what kind of things you are creating?if I may ask
Pieter Stokkink
@forkerino
Jul 24 2017 21:36
@tiagocorreiaalmeida We are building an app that helps people design solar panel systems and calculate yearly yields. Mostly aimed at businesses installing these systems, but more and more directly to consumers as well. I'm working mostly on the editor in the frontend.
but now it's bed time.
forkerino @forkerino :zzz:
kumquatfelafel
@kumquatfelafel
Jul 24 2017 21:37
night
Pieter Stokkink
@forkerino
Jul 24 2017 21:37
:wave: :sleeping:
Jason Luboff
@JLuboff
Jul 24 2017 21:37
@forkerino night
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:37
@forkerino nice mate good night
@kumquatfelafel can I show you my exercise?code might looks confusing but I wanna try to end the way I start and then improve if oyu can give a little help
kumquatfelafel
@kumquatfelafel
Jul 24 2017 21:39
willing to look at, though I'm not the best of coders. :p
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:39

function pairwise(arr, arg) {
  return arr.reduce(function(acc, obj,index, array){ 
    for(var i = 0; i < arr.length; i++){
      if(obj + arr[i] === arg && arr.indexOf(arr[i]) !== arr[index]){
        acc += arr.indexOf(arr[i]);
        acc += array[index];
        arr.slice(arr.indexOf(arr[i]),1);
        arr.slice(array[index],1);
      }
    }
    return acc;
  },0);
}

pairwise([1,4,2,3,0,5], 7);
this look so messy
plus my slice is made the wrong way
I wanna to do arr[i] +1 in the 2 value passed right?
kumquatfelafel
@kumquatfelafel
Jul 24 2017 21:40
arr. slice doesn't accomplish any meaningful task unless you store the value in a variable or return it
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:40
doint know completly confused :D
What I wanna do is atually
remove those values
from the array
so when reduce runs again
those values are nt there anymore
they can only be used 1 time

function pairwise(arr, arg) {
  return arr.reduce(function(acc, obj,index, array){ 
    for(var i = 0; i < arr.length; i++){
      if(obj + arr[i] === arg && arr.indexOf(arr[i]) !== arr[index]){
        acc += arr.indexOf(arr[i]);
        acc += array[index];
        arr.slice(0, arr.indexOf(arr[i])).concat(arr.slice(arr.indexOf(arr[i])+1));
        arr.slice(0, array[index]).concat(arr.slice(array[index]+1));
      }
    }
    return acc;
  },0);
}

pairwise([1,4,2,3,0,5], 7);
still doenst work the way I need it to :(
kumquatfelafel
@kumquatfelafel
Jul 24 2017 21:53

You're still not storing the result of arr. slice into a variable.
arr. slice does not modify the original array, it returns a new array. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice

It's like if I had a snowball, and I made another snowball very similar to it, and rolled that new snowball down a hill to you. However, you fail to catch it as it's rolling past.
As a result, I still have the original snowball, but the one you failed to catch fell off a cliff and is no longer useable.

Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:53
solved that
but found another problem :D

function pairwise(arr, arg) {
  return arr.reduce(function(acc, obj,index, array){
    for(var i = 0; i < arr.length; i++){
      if(obj + arr[i] === arg && arr.indexOf(arr[i]) !== arr[index]){
        acc += array.indexOf(array[i]);
        acc += array[index];
       arr = arr.slice(0, arr.indexOf(arr[i])).concat(arr.slice(arr.indexOf(arr[i])+1));
       arr = arr.slice(0, array[index]).concat(arr.slice(array[index]+1));
      }
    }
    return acc;
  },0);
}

pairwise([1,4,2,3,0,5], 7);
everytime it goes inside the if statement
it will remove 1 value from the arr
so next time the position of the vlaue will not be the same
anyway I can work around this?
how about updating that vlaue to =0;
yeah might work Im the lord of mixing things
kumquatfelafel
@kumquatfelafel
Jul 24 2017 21:54
@tiagocorreiaalmeida your accumulator and choice of reduce is also kind of strange.
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:54
and never making it work xd
kumquatfelafel
@kumquatfelafel
Jul 24 2017 21:55
actually, reduce could work... just... what you're doing inside is strange. :p
Still, for now, let's pretend that reduce doesn't exist, and just take a look at what's goin' on inside it.
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 22:01

function pairwise(arr, arg) {
  return arr.reduce(function(acc, obj,index, array){
    for(var i = 0; i < arr.length; i++){
      if(obj + arr[i] === arg && arr.indexOf(arr[i]) !== arr[index] && arr[i] !==0){
        acc += array.indexOf(array[i]);
        acc += array[index];
        arr[i] = 0;
        var temp = array[index];
        arr[temp] = 0;
      }
    }
    return arr;
  },0);
}

pairwise([1,4,2,3,0,5], 7);
gave up gonna watch some tutoria lon this
István Kozma
@Manfred28
Jul 24 2017 22:02
tbh obj + arr[i] === arg seems as strange as it gets to me, if obj really is an object here, you are kind of expecting js to turn it into a primitive value that can be used in this context...which I imagine it will try to do, but still
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 22:04
thanks both
István Kozma
@Manfred28
Jul 24 2017 22:06

also, declare stuff like

var temp = array[index];

at the top of the block

so directly on the new line after the curly braces
you also don't seem to be using this value for anything
but I guess that doesn't get you any closer to an actual solution to your problem :P
kumquatfelafel
@kumquatfelafel
Jul 24 2017 22:07
@Manfred28 that particular condition check is fine. The arr[i] !==0 is wrong though.
Note this particular test case...
pairwise([0, 0, 0, 0, 1, 1], 1)... returns 10.
@Manfred28 I believe what they're trying to do by assigning value of 0 was a result of running into problems that resulted from changing the length of the array.
István Kozma
@Manfred28
Jul 24 2017 22:09
maybe, but if obj is actually just an integer here, naming it obj is incredibly misleading
I mean, temp is declared to be the same as the length of the array, and then set to be 0
it literally doesn't do anything, whatever it might be intended to do
I am not saying anything you said is wrong, I am sure you have a clearer idea of whats going on here, but just looking at the code, those are 2 things that stand out to me
kumquatfelafel
@kumquatfelafel
Jul 24 2017 22:13

@Manfred28 well... it does something. What it does is very wrong though.

if the value at array[index] is 5, for example, this incorrectly sets the value of arr[5] to 0.

Which could influence ability to find future pairs, and yada yada yada
István Kozma
@Manfred28
Jul 24 2017 22:13
it doesnt modify array[index]
kumquatfelafel
@kumquatfelafel
Jul 24 2017 22:14
aware of this, yes. But it modifies arr, and arr is used in if statement to check for "pairs".
István Kozma
@Manfred28
Jul 24 2017 22:15
no, frankly, it doesnt modify anything
all it does it assigns a value to temp
presumably, array[index] is a primitive value
even if it isnt, it doesnt modify anything, but judging by the exercise, it is
you create a variable, and assign to it some value that you find in an array
there is 0 connection to the original array
you just transferred some value to the variable temp
and then you modify that variable to be something else, but there is no actual connection to the original array
now, if you did something like
temp = myArray;
temp.push(1);
kumquatfelafel
@kumquatfelafel
Jul 24 2017 22:17
That's not how assignment works with primitives in javascript.
István Kozma
@Manfred28
Jul 24 2017 22:17
this would modify the original array, because you modify the array in place
kumquatfelafel
@kumquatfelafel
Jul 24 2017 22:18

https://repl.it/Jg4V

Run this code @Manfred28

István Kozma
@Manfred28
Jul 24 2017 22:18
you understand you do something different here
you modify a value in the array
which this code doesnt do with temp
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 22:19
@Manfred28 just did the exercise
was making it hard
such simple thing
István Kozma
@Manfred28
Jul 24 2017 22:19
ih
im retarded
sorry
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 22:19
I had the right idea in my idea
but confused it all when I started coding
anyway thanks both for you time
István Kozma
@Manfred28
Jul 24 2017 22:19
those 2 lines are still weird as fuck but I see what I missed :P
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 22:20
I changed it completly
kumquatfelafel
@kumquatfelafel
Jul 24 2017 22:20
@Manfred28 np. It took me a fair amount of time to figure out what was going on when read it. :p
István Kozma
@Manfred28
Jul 24 2017 22:20
thanks @kumquatfelafel I suppose, you deserve them cookies :P
CamperBot
@camperbot
Jul 24 2017 22:20
manfred28 sends brownie points to @kumquatfelafel :sparkles: :thumbsup: :sparkles:
:cookie: 533 | @kumquatfelafel |http://www.freecodecamp.com/kumquatfelafel
kumquatfelafel
@kumquatfelafel
Jul 24 2017 22:21
well... I didn't really do much :laughing:
István Kozma
@Manfred28
Jul 24 2017 22:21
you taught me never to talk about coding when slightly drunk >_>
kumquatfelafel
@kumquatfelafel
Jul 24 2017 22:21
@tiagocorreiaalmeida congrats. Done with algorithms?

talk about coding when slightly drunk

@Manfred28 To be fair, I do this reasonably often. And result is almost always almost okay. :o

Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 22:23

function pairwise(arr, arg) {
  return arr.reduce(function(acc, value,index, array){
    for(var i = index +1; i < array.length; i++){
      if(array[index] + arr[i] === arg){
        acc += i + index;
        array[index] = array[i] = NaN;
      }
    }
    return acc;
  },0);
}

pairwise([1,4,2,3,0,5], 7);
so simple and..
Ala Pota
@alapota
Jul 24 2017 22:24
Thank you @Takumar, it wasn't so difficult after all
CamperBot
@camperbot
Jul 24 2017 22:24
alapota sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star2: 3777 | @takumar |http://www.freecodecamp.com/takumar
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 22:24
saw it on a tutorial it does what I need it check every value less the one Im curretly going on the reduce method second it turns all the values that I allready used into not numbers so I dont use them again but they still exist
@kumquatfelafel just a little question
for the "Build a JavaScript Calculator"
we are suposed to make the html css ?:D
dyon3334
@dyon3334
Jul 24 2017 22:24
javascript: switch vs if ?
kumquatfelafel
@kumquatfelafel
Jul 24 2017 22:25
@tiagocorreiaalmeida you had right idea for what you were doing with changing value of array index, but 0 would have been no good. Your other problem was acc += array[index]; (gives value at that index) ;)
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 22:26
I know eheheh cause it should only be index, we are suposed to build the layout or are there any mades one?
Stephen James
@sjames1958gm
Jul 24 2017 22:26
@dyon3334 depends on the circumstance
@tiagocorreiaalmeida You are supposed to do the layout as well as the js
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 22:27
sounds well thanks :)
good night everyone
Aleksander Gębicki
@Takumar
Jul 24 2017 22:27
Good night @tiagocorreiaalmeida - have a nice evening!
GSGV
@GSGV
Jul 24 2017 22:35

var count = 0;

function cc(card) {
// Only change code below this line
switch (card){
case 2:
case 3:
case 4:
case 5:
case 6:
count++;
break;
case 10:
case "J":
case "Q":
case "K":
case "A":
count--;
}

In the casino game Blackjack, a player can gain an advantage over the house by keeping track of the relative number of high and low cards remaining in the deck. This is called Card Counting.

Having more high cards remaining in the deck favors the player. Each card is assigned a value according to the table below. When the count is positive, the player should bet high. When the count is zero or negative, the player should bet low.

Count Change Cards
+1 2, 3, 4, 5, 6
0 7, 8, 9
-1 10, 'J', 'Q', 'K', 'A'
You will write a card counting function. It will receive a card parameter and increment or decrement the global count variable according to the card's value (see table). The function will then return a string with the current count and the string "Bet" if the count is positive, or "Hold" if the count is zero or negative. The current count and the player's decision ("Bet" or "Hold") should be separated by a single space.

Example Output
"-3 Hold"
"5 Bet"

Hint
Do NOT reset count to 0 when value is 7, 8, or 9.

My Code:
if (count>0){
return count + "Bet";
}
else {
return count + "Hold";
}

// Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');

excuse me... what's wrong with my code?
var count = 0;

function cc(card) {
// Only change code below this line
switch (card){
case 2:
case 3:
case 4:
case 5:
case 6:
count++;
break;
case 10:
case "J":
case "Q":
case "K":
case "A":
count--;
}

if (count>0){
return count + "Bet";
}
else {
return count + "Hold";
}

// Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');

Stephen James
@sjames1958gm
Jul 24 2017 22:37
@GSGV From the instructions: should be separated by a single space
GSGV
@GSGV
Jul 24 2017 22:37
got it.... whoops
thanks @sjames1958gm
CamperBot
@camperbot
Jul 24 2017 22:38
gsgv sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8148 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Jul 24 2017 22:38
@GSGV :+1:
Jason Luboff
@JLuboff
Jul 24 2017 22:49
@kumquatfelafel Got my Phishing page created :+1:
Johnny
@JohnnyBizzel
Jul 24 2017 23:25
@JLuboff After people's passwords?
Jason Luboff
@JLuboff
Jul 24 2017 23:26
@JohnnyBizzel People in my organization...We've had a decent handful get phished in the last couple months and need to be able to educate and test them..
Johnny
@JohnnyBizzel
Jul 24 2017 23:27
@JLuboff Ah. You should get their credit card details too! :joy:
aRtoo
@artoodeeto
Jul 24 2017 23:29
how do you put an background in css? i have this but its not working.
  background: url('img/science.png') center center no-repeat;
korzo
@korzo
Jul 24 2017 23:30
@artoodeeto define 'not working'
aRtoo
@artoodeeto
Jul 24 2017 23:30
@korzo what do you mean??
@korzo is that in console? im not getting any/
Jason Luboff
@JLuboff
Jul 24 2017 23:31
@JohnnyBizzel ...they would probably fall for it
kumquatfelafel
@kumquatfelafel
Jul 24 2017 23:32
@JLuboff woot!
korzo
@korzo
Jul 24 2017 23:32
@artoodeeto What do you mean 'not working' ?
Image doesn't show?
It's url of image correct? (see console for errors)
Johnny
@JohnnyBizzel
Jul 24 2017 23:32
@JLuboff No doubt. ;)
@artoodeeto see example 1 https://codepen.io/imprakash/pen/GgNMXO
Jason Luboff
@JLuboff
Jul 24 2017 23:32
@artoodeeto should'nt it be background-image: url("image.png")
aRtoo
@artoodeeto
Jul 24 2017 23:32
@korzo yes. no errors. in the console.
kumquatfelafel
@kumquatfelafel
Jul 24 2017 23:32
@JohnnyBizzel see, now that's what I've been saying. Full commitment, get everything. :o
Johnny
@JohnnyBizzel
Jul 24 2017 23:32
aRtoo
@artoodeeto
Jul 24 2017 23:33
@JLuboff theres a example too of background. tried both didnt work
kumquatfelafel
@kumquatfelafel
Jul 24 2017 23:33
And don't forget to ransomware their stuff. :p
korzo
@korzo
Jul 24 2017 23:33
@artoodeeto has your element with background some height?
Post link to your pen
Jason Luboff
@JLuboff
Jul 24 2017 23:33
@artoodeeto Is it in codepen? I seem to recall it can be goofy
Johnny
@JohnnyBizzel
Jul 24 2017 23:33
@kumquatfelafel If you want to do it do it right....!
aRtoo
@artoodeeto
Jul 24 2017 23:33
@JohnnyBizzel @JLuboff @korzo its working on a link but not on my local file
Johnny
@JohnnyBizzel
Jul 24 2017 23:33
Denied! :(
aRtoo
@artoodeeto
Jul 24 2017 23:33
@korzo yup specified too
Johnny
@JohnnyBizzel
Jul 24 2017 23:34
@artoodeeto does it work as an <img>
aRtoo
@artoodeeto
Jul 24 2017 23:34
@JohnnyBizzel on html? i think. but i want to work it on the css. :9
Johnny
@JohnnyBizzel
Jul 24 2017 23:35
@artoodeeto just trying to rule out whether it is the pathing to the image
kumquatfelafel
@kumquatfelafel
Jul 24 2017 23:35
@JLuboff come to think of it, you should ransomware their stuff and be like "if you don't download this file on your work computer, blah blah blah" and then get super angry at them when they do it. And the malicious file is actually a copy of the game "snake" :o
Johnny
@JohnnyBizzel
Jul 24 2017 23:35
@kumquatfelafel Creative!
Jason Luboff
@JLuboff
Jul 24 2017 23:36
@kumquatfelafel Lol. Thats a step beyond what we're aiming for I think ;)
aRtoo
@artoodeeto
Jul 24 2017 23:36
@JohnnyBizzel i have a folder named twitch and inside is the image folder with the science.png
Johnny
@JohnnyBizzel
Jul 24 2017 23:36
@artoodeeto Were the examples any use?
aRtoo
@artoodeeto
Jul 24 2017 23:37
@JohnnyBizzel no. but its working on http or web links
kumquatfelafel
@kumquatfelafel
Jul 24 2017 23:37
@JLuboff just wait for it... it's coming next. :p
aRtoo
@artoodeeto
Jul 24 2017 23:39
@JohnnyBizzel tried that one too. followed instruction didnt work. haha
aRtoo
@artoodeeto
Jul 24 2017 23:39
@JohnnyBizzel that one too. haha. its alright maybe its the laptop
aRtoo
@artoodeeto
Jul 24 2017 23:44
@JohnnyBizzel got it now sir. thanks
CamperBot
@camperbot
Jul 24 2017 23:44
artoodeeto sends brownie points to @johnnybizzel :sparkles: :thumbsup: :sparkles:
:star2: 1731 | @johnnybizzel |http://www.freecodecamp.com/johnnybizzel
Johnny
@JohnnyBizzel
Jul 24 2017 23:44
@artoodeeto :+1: