These are chat archives for FreeCodeCamp/HelpJavaScript

1st
Aug 2016
greg
@wearenotgroot
Aug 01 2016 00:00
@yodermail :+1:
@yodermail remove the s in "No such contacts". i think
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 00:01
@silver537 did you use parseInt()? when you did this one?
Carrie
@yodermail
Aug 01 2016 00:01
@wearenotgroot HA! you're right. I love and hate when the problem is something stupid like that lol
silver537
@silver537
Aug 01 2016 00:01
@no-stack-dub-sack no i used String.fromChar()
Michael Noronha
@mtn
Aug 01 2016 00:01
@Chrono79 can you think of a reason this%20%7B%0A%20%20arr%20%3D%20str.toLowerCase().split('%20')%3B%0A%20%20str%20%3D%20%22%22%3B%0A%20%20for(var%20i%20%3D%200%3B%20i%20%3C%20arr.length%3B%20i%2B%2B)%7B%0A%20%20%09arr%5Bi%5D%3Darr%5Bi%5D.substring(0%2C1).toUpperCase()%2Barr%5Bi%5D.substring(1%2Carr%5Bi%5D.length)%3B%0A%20%20%09str%20%3D%20str.concat(%22%20%22%2B%20arr%5Bi%5D)%3B%0A%20%20%7D%0A%20%20return%20str%3B%0A%7D%0A%0AtitleCase(%22I'm%20a%20little%20tea%20pot%22)%3B%0A%0A) won't pass even though testing cases in repl.it seems to return values that should be passing?
silver537
@silver537
Aug 01 2016 00:01
and charAt()
Michael Noronha
@mtn
Aug 01 2016 00:01
oh whoops
greg
@wearenotgroot
Aug 01 2016 00:02
@yodermail :smile:
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 00:02
@silver537 gotcha...
Phil
@mremotoo
Aug 01 2016 00:03
@yodermail the challenges can be very strict with the terms that it wants you to write
Michael Noronha
@mtn
Aug 01 2016 00:03
@Chrono79 I think the parenthesis messed with my md. here is the repl.it link
greg
@wearenotgroot
Aug 01 2016 00:03
@b1td0wn -------->Add the number to the end of the array, then remove the first element of array
Now review the previous lesson and look for array methods that can do those things
Michael Noronha
@mtn
Aug 01 2016 00:03
@Chrono79 based on testing cases, it returns all the right values; when I paste into fcc it doesn't pass
@Chrono79 any ideas?
Phil
@mremotoo
Aug 01 2016 00:03
@yodermail it has to be exact. Just a tip, you can just do copy paste =)
Diego Mayer
@Chrono79
Aug 01 2016 00:03
@michaeltnoronha you add a space at the first word that shouldn't be there after all
better use join, or don't add it if i === 0
Michael Noronha
@mtn
Aug 01 2016 00:04
@Chrono79 I was about to add the if i===0; is join better?
@Chrono79 and does it automatically add spaces or somthing?
silver537
@silver537
Aug 01 2016 00:04
@michaeltnoronha yup
its the opposite of split()
Diego Mayer
@Chrono79
Aug 01 2016 00:04
@michaeltnoronha join will add the space between the words, that's exactly what you want
Mike
@MikeJSchorah
Aug 01 2016 00:05
@codebonobo I have to send you another thank you. This has given me hope. Not only am I going to complete the Algorithms course on EdEx, but the Algorithms course on Coursera AND I'm going to get several books on Algorithms off of Amazon. Perfect! You have given me hope and possibly saved me thousands of dollars. That alone deserves hundreds of thank yous.
CamperBot
@camperbot
Aug 01 2016 00:05
mikejschorah sends brownie points to @codebonobo :sparkles: :thumbsup: :sparkles:
:warning: mikejschorah already gave codebonobo points
Michael Noronha
@mtn
Aug 01 2016 00:05
@silver537 @Chrono79 so it wouldn't be in the loop right?
Diego Mayer
@Chrono79
Aug 01 2016 00:05
no
silver537
@silver537
Aug 01 2016 00:06
hmm it worked inside the loop for me
Michael Noronha
@mtn
Aug 01 2016 00:06
@Chrono79 no as in it's outside, or somethign else?
Marc Droz
@b1tc0de
Aug 01 2016 00:06
thanks @wearenotgroot
CamperBot
@camperbot
Aug 01 2016 00:06
b1td0wn sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star2: 1258 | @wearenotgroot |http://www.freecodecamp.com/wearenotgroot
Diego Mayer
@Chrono79
Aug 01 2016 00:06
@michaeltnoronha put it outside, just like split is outside too
Michael Noronha
@mtn
Aug 01 2016 00:07
@Chrono79 gotcha. not sure if I can thank again yet, but @Chrono79 @silver537 thanks!
CamperBot
@camperbot
Aug 01 2016 00:07
michaeltnoronha sends brownie points to @chrono79 and @silver537 :sparkles: :thumbsup: :sparkles:
:warning: michaeltnoronha already gave silver537 points
:warning: michaeltnoronha already gave chrono79 points
silver537
@silver537
Aug 01 2016 00:07
@michaeltnoronha lets see your code
Lauren
@LaurenDoughty
Aug 01 2016 00:08
@MikeJSchorah I sent you a couple pm's, I'm really glad I could help you out :)
Janine vN
@janine9vn
Aug 01 2016 00:08
@Chrono79 Very delayed because I got distracted with dinner, but thank you!!
That made a lot of sense and I got the challenge correct as soon as I made the change.
CamperBot
@camperbot
Aug 01 2016 00:08
janine9vn sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 1695 | @chrono79 |http://www.freecodecamp.com/chrono79
Michael Noronha
@mtn
Aug 01 2016 00:08
oh
i can actually change it
Mike
@MikeJSchorah
Aug 01 2016 00:09
@codebonobo I forgot how to check PMs
Michael Noronha
@mtn
Aug 01 2016 00:09
silver537
@silver537
Aug 01 2016 00:09
lol yea
i love that website
Lauren
@LaurenDoughty
Aug 01 2016 00:10
@MikeJSchorah no worries there's a person icon above the FCC fire, on the left side of your screen, that's where your PMs are when you click that, they open
silver537
@silver537
Aug 01 2016 00:10
did it pass?
Michael Noronha
@mtn
Aug 01 2016 00:10
it's really awesome for this sort of thing
yep!
silver537
@silver537
Aug 01 2016 00:10
alright.. now your real challenge is to use only string and array methods.
Michael Noronha
@mtn
Aug 01 2016 00:11
@silver537 accepted
silver537
@silver537
Aug 01 2016 00:11
no variables except for the str variable. @michaeltnoronha
no for loop
Mike
@MikeJSchorah
Aug 01 2016 00:11
@codebonobo That's the thing, I'm working on a Mac
Lauren
@LaurenDoughty
Aug 01 2016 00:12
@MikeJSchorah cool! I used them a lot for years, anyway in the PMs I just said -
silver537
@silver537
Aug 01 2016 00:13

you should only have

function titleCase(str){
  return str.method().method().method().method()... etc etc;
}

@michaeltnoronha

Lauren
@LaurenDoughty
Aug 01 2016 00:13
@MikeJSchorah That is awesome, I'm really happy that I could help you out, please stay in touch, I'd love to know how you are coming along
Michael Noronha
@mtn
Aug 01 2016 00:13
@silver537 I pasted that in and it didn't work halppp!!!! jkjk
Rahin Ahmed
@rahin1122
Aug 01 2016 00:14

hi guys I,m stuck here .I dont know how to do .var collection = {
"2548": {
"album": "Slippery When Wet",
"artist": "Bon Jovi",
"tracks": [
"Let It Rock",
"You Give Love a Bad Name"
]
},
"2468": {
"album": "1999",
"artist": "Prince",
"tracks": [
"1999",
"Little Red Corvette"
]
},
"1245": {
"artist": "Robert Palmer",
"tracks": [ ]
},
"5439": {
"album": "ABBA Gold"
}
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) {
if(prop !=="tracks" && value !==""){

collection[id][prop]=value;

}

if(!collection[id].hasOwnProperty("tracks")){
collection[id][prop]=[];

}
if(prop === "tracks" && value !==""){

collection[id][prop].push(value);

}

else
delete collection[id][prop];
}

// Alter values below to test your code
updateRecords(5439, "artist", "ABBA");

silver537
@silver537
Aug 01 2016 00:14
lol
higher ordered functions makes everything easier.
Justin Steele
@JustinSteele02
Aug 01 2016 00:14
I can't figure out what I'm doing wrong with the Diff Two Arrays challenge. Trying to use nested for loops to cycle through both arrays and splice out the values that are the same.
function diffArray(arr1, arr2) {    
  for (i = 0; i < arr1.length; i++) {
    for (j = 0; j < arr2.length; j++) {
      if (arr1[i] == arr2[j]) {
        arr1.splice(i, 1);
        arr2.splice(j, 1);
      }
    }
  }

  return arr1.concat(arr2);
}

diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);
With these arguments, it outputs [2, 2, 4]
So the 2 isn't getting matched for some reason?
Rahin Ahmed
@rahin1122
Aug 01 2016 00:16
hi guys How can i share code to chat room .Is there anyone can help me .
Justin Steele
@JustinSteele02
Aug 01 2016 00:17
@rahin1122 for single line, surround it with backticks (above Tab key)
silver537
@silver537
Aug 01 2016 00:17
@rahin1122 use backticks next to the 1 key
Justin Steele
@JustinSteele02
Aug 01 2016 00:17
for multi line, a row of 3 backticks above and below the code. Use shift-enter to go to a new line without sending
greg
@wearenotgroot
Aug 01 2016 00:17
This message was deleted
Rahin Ahmed
@rahin1122
Aug 01 2016 00:17
@JustinSteele02 Do i have top press on that key .
greg
@wearenotgroot
Aug 01 2016 00:17
help format
CamperBot
@camperbot
Aug 01 2016 00:17

:point_right: code formatting [wiki]

Multi line Code

```js ⇦ Type 3 backticks and then press [shift + enter ⏎] (type js or html or css)

<paste your code here>,
then press [shift + enter ⏎]

``` ⇦ Type 3 backticks, then press [enter ⏎]

Single line Code

This an inline `<paste code here>` code formatting with a single backtick() at _start_ and _end_ around thecode`.

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

:pencil: read more about code formatting on the FCC Wiki

Rahin Ahmed
@rahin1122
Aug 01 2016 00:19
var collection = {
    "2548": {
      "album": "Slippery When Wet",
      "artist": "Bon Jovi",
      "tracks": [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    "2468": {
      "album": "1999",
      "artist": "Prince",
      "tracks": [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    "1245": {
      "artist": "Robert Palmer",
      "tracks": [ ]
    },
    "5439": {
      "album": "ABBA Gold"
    }
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) {
  if(prop !=="tracks" && value !==""){

    collection[id][prop]=value;

  }

   if(!collection[id].hasOwnProperty("tracks")){
    collection[id][prop]=[];

  }
   if(prop === "tracks" && value !==""){

    collection[id][prop].push(value);

  }

  else
   delete collection[id][prop];
}

// Alter values below to test your code
updateRecords(5439, "artist", "ABBA");
```
I got stuck there .My code is not executing following instruction completly stuck .
silver537
@silver537
Aug 01 2016 00:20
which one didn't pass?
Diego Mayer
@Chrono79
Aug 01 2016 00:21

@rahin1122 you have to return collection always
Also move this:

   if(!collection[id].hasOwnProperty("tracks")){
    collection[id][prop]=[];

  }

inside this if
if(prop === "tracks" && value !==""){

Rahin Ahmed
@rahin1122
Aug 01 2016 00:21
Is there anyone could help me to write the correct code for me .
silver537
@silver537
Aug 01 2016 00:21
oh yeeeeeaaa..
Rahin Ahmed
@rahin1122
Aug 01 2016 00:21
@Chrono79 I have seen your code But i could not get it all logic.
@Chrono79 Where to move this .
Diego Mayer
@Chrono79
Aug 01 2016 00:23
@rahin1122 already told you where
silver537
@silver537
Aug 01 2016 00:24
before all your if statements
just to make it easy for you
Rahin Ahmed
@rahin1122
Aug 01 2016 00:26
Hi @Chrono79 I just moved if(prop === "tracks" && value !==""){
@Chrono79 inside if(!collection[id].hasOwnProperty("tracks")){
collection[id][prop]=[];
}
Diego Mayer
@Chrono79
Aug 01 2016 00:27
@rahin1122 copy and paste only your function now
It was the other way around, try to figure out why
silver537
@silver537
Aug 01 2016 00:27
uh oh... he moved the wrong one
Rahin Ahmed
@rahin1122
Aug 01 2016 00:28

@Chrono79 ```// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) {
if(prop !=="tracks" && value !==""){

collection[id][prop]=value;

}

if(!collection[id].hasOwnProperty("tracks")){
collection[id][prop]=[];

if(prop === "tracks" && value !==""){

collection[id][prop].push(value);

}
}

else
delete collection[id][prop];
}

// Alter values below to test your code
updateRecords(5439, "artist", "ABBA");
```

silver537
@silver537
Aug 01 2016 00:29
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));
// Only change code below this line
function updateRecords(id, prop, value) {
if(prop !=="tracks" && value !==""){
collection[id][prop]=value;
}
if(!collection[id].hasOwnProperty("tracks")){
  collection[id][prop]=[];
  if(prop === "tracks" && value !==""){
    collection[id][prop].push(value);
    }
  }
  else
    delete collection[id][prop];
}
// Alter values below to test your code
updateRecords(5439, "artist", "ABBA");
Rahin Ahmed
@rahin1122
Aug 01 2016 00:29
@Chrono79 How to do it in inside the backticks .
Diego Mayer
@Chrono79
Aug 01 2016 00:30
@rahin1122 you moved the ifs the wrong way, the outer should be the inner and viceversa
silver537
@silver537
Aug 01 2016 00:30
@rahin1122 backticks have to be on their own line
Rahin Ahmed
@rahin1122
Aug 01 2016 00:31
@Chrono79 Let me help to share code again in chat room using backtips .
Sorry backtics.
Rahin Ahmed
@rahin1122
Aug 01 2016 00:39
@Chrono79 Is that my code is not written in a correct way ? .
Diego Mayer
@Chrono79
Aug 01 2016 00:39
:point_up: 31 de julio de 2016 21:21 @rahin1122
Yes, you moved the code the wrong way
Rahin Ahmed
@rahin1122
Aug 01 2016 00:42
@Chrono79 I have done this but It is still not working .
Diego Mayer
@Chrono79
Aug 01 2016 00:43
@rahin1122
  if(prop === "tracks" && value !==""){
    if(!collection[id].hasOwnProperty("tracks")){
      collection[id][prop]=[];
    }
    collection[id][prop].push(value);
  }
x981
@x981
Aug 01 2016 00:43
@Masd925 "@Masd925
"in addTogether(a)(b), In addTogether(a, b), arguments.length is 2." => addTogether(a)(b) has arguments.length = 1, you can try.
Rahin Ahmed
@rahin1122
Aug 01 2016 00:45
@Chrono79 Let me just again help me to share code with you using backtics .
   if(prop === "tracks" && value !==""){
   if(!collection[id].hasOwnProperty("tracks")){
    collection[id][prop]=[];
   }
      collection[id][prop].push(value);
   }
Diego Mayer
@Chrono79
Aug 01 2016 00:47
@rahin1122 did you add return collection before the end of your function?
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 00:48
@silver537 you still hangin around?
silver537
@silver537
Aug 01 2016 00:48
yep
Rahin Ahmed
@rahin1122
Aug 01 2016 00:48
@Chrono79 Is it here ```
@Chrono79 ```
```
```
else
delete return collection[id][prop];
}
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 00:49
@silver537 interested to see how you completed yours... I couldn't figure it out without parseInt(). It seems like a decent solution but I'm always interested in alternatives. Here's mine:
function binaryAgent(str) {
  str = str.split(" ");
  var binaryToDecimal = [];
  while (str.length > 0) {
    binaryToDecimal.push(parseInt(str[0], 2));
    str.shift();
  }
  binaryToDecimal.join(",20,");
  return String.fromCharCode.apply(null, binaryToDecimal);
}

binaryAgent("01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111");
Rahin Ahmed
@rahin1122
Aug 01 2016 00:50
This message was deleted
```
Diego Mayer
@Chrono79
Aug 01 2016 00:50
@rahin1122 no, it's after all the if/else, the last else should delete
silver537
@silver537
Aug 01 2016 00:51
@no-stack-dub-sack
binaryTranslator=(str)=>{
    let x = 0, y = 0, binaray = [128,64,32,16,8,4,2,1];
    str.split('').forEach(z=>{return (z == 1)?(x+=binaray[y],y++):(x += 0, y++);});
    return String.fromCharCode(x);
};
binaryAgent=(str)=>{
    let sentence = [];
    str = str.split(' ');
    for(let x = 0; x < str.length; x++){
        sentence.push(binaryTranslator(str[x]));
    }
    return sentence.join('');
};
Rahin Ahmed
@rahin1122
Aug 01 2016 00:51
@Chrono79 I am really not being able to get it where you want to return it .
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 00:52
@silver537 interesting, yeah this is def a more complex solution than mine. My brain would not have went there.
Diego Mayer
@Chrono79
Aug 01 2016 00:53
  if...
    ... // your code
  else delete collection[id][prop];

  return collection;
}
silver537
@silver537
Aug 01 2016 00:53
@no-stack-dub-sack im going to disect your code in an editor to understand why you did what you did.
Rahin Ahmed
@rahin1122
Aug 01 2016 00:54

```var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) {
if(prop !=="tracks" && value !==""){
collection[id][prop]=value;
}

if(prop === "tracks" && value !==""){
if(!collection[id].hasOwnProperty("tracks")){
collection[id][prop]=[];
}
collection[id][prop].push(value);
}

else delete collection[id][prop];
return collection;
}
```

This message was deleted
This message was deleted
silver537
@silver537
Aug 01 2016 00:55
@no-stack-dub-sack i would have not done a while with shift(). but then again.. i try my hardest not to chanage the original variables.
Diego Mayer
@Chrono79
Aug 01 2016 00:56
@rahin1122 it seems ok
leave the ``` in its own line (using shift+enter)
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 00:57
@silver537 fair enough, the key is in parseInt() for mine, taking the binary value, running it through this and defining a base of 2 (since binary) gives the decimal value for each letter
Rahin Ahmed
@rahin1122
Aug 01 2016 00:58
@Chrono79 But still not executing why ? . I am a new coder Diego .It just two and half months .Still not realising many things.
This message was deleted
silver537
@silver537
Aug 01 2016 00:59
@no-stack-dub-sack i never heard of parseInt which is why i didn't use it. lol but parseInt() seems more efficient
Rahin Ahmed
@rahin1122
Aug 01 2016 00:59
This message was deleted
silver537
@silver537
Aug 01 2016 00:59
now that i understand what parseInt does, i understand your code. thanks for helping me consolidate my code as well. :D @no-stack-dub-sack
CamperBot
@camperbot
Aug 01 2016 00:59
silver537 sends brownie points to @no-stack-dub-sack :sparkles: :thumbsup: :sparkles:
:cookie: 313 | @no-stack-dub-sack |http://www.freecodecamp.com/no-stack-dub-sack
Rahin Ahmed
@rahin1122
Aug 01 2016 01:00
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) {
  if(prop !=="tracks" && value !==""){  
    collection[id][prop]=value;   
  }

   if(prop === "tracks" && value !==""){
   if(!collection[id].hasOwnProperty("tracks")){
    collection[id][prop]=[];
   }
      collection[id][prop].push(value);
   }


 else  delete  collection[id][prop];
  return collection;
}
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 01:00
@silver537 It's funny, it does seem more efficient, but I don't know that I would have been able to solve it without it - at least without considerable strife along the way. So kudos to you for figuring it out! No prob, thanks for showing me another way. Always good to know more than one
CamperBot
@camperbot
Aug 01 2016 01:00
no-stack-dub-sack sends brownie points to @silver537 :sparkles: :thumbsup: :sparkles:
:cookie: 441 | @silver537 |http://www.freecodecamp.com/silver537
Diego Mayer
@Chrono79
Aug 01 2016 01:00
@rahin1122 you need an else before this if:
if(prop === "tracks" && value !==""){
otherwise you will be deleting the prop with the last else
silver537
@silver537
Aug 01 2016 01:01
@no-stack-dub-sack i used the same method in ceasers cipher
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 01:02
@silver537 @silver537 yeah. mine's quite a bit different than that
Rahin Ahmed
@rahin1122
Aug 01 2016 01:03
@Chrono79 Why should i use else before : if(prop === "tracks" && value !==""){ .Is it a format of writing correct syntax .
Diego Mayer
@Chrono79
Aug 01 2016 01:03
@rahin1122 it's logic flow, otherwise you should write
if (value === "") instead of the last else
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 01:05
@silver537 how come you declare your functions like that?
instead of in the traditional way?
preference?
silver537
@silver537
Aug 01 2016 01:05
like this binaryAgent=(str)=>
?
Rahin Ahmed
@rahin1122
Aug 01 2016 01:06
Ok @Chrono79 Thank you it has now executed .
CamperBot
@camperbot
Aug 01 2016 01:06
rahin1122 sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 1696 | @chrono79 |http://www.freecodecamp.com/chrono79
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 01:06
yeah, as opposed to function test(str)
@silver537 is that just the more ES6ish way?
silver537
@silver537
Aug 01 2016 01:06
its a discipline. limit myself to learn the es6 version.
yea
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 01:07
@silver537 gotcha
just curious
silver537
@silver537
Aug 01 2016 01:07
its very useful in array methods
like
[1,2,3,4,5].map(x=>x*x) logs 1,4,9,16,25 with as few characters as possible.
instead of
[1,2,3,4,5].map(function(x){return x*x;})
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 01:10
@silver537 phwewwww, just ran both of our codes through the pythontutor visualizer, and it really is significant how much more efficient the parseint() way is... reduces to 70 steps from 514
silver537
@silver537
Aug 01 2016 01:10
@no-stack-dub-sack lol told you
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 01:11
@silver537 Yeah, I've been using arrow functions in cases like that, but not to declare the functions to begin with. I didn't even know you could. What other sources are you using to learn ES6?
Luis Felipe López G.
@luishendrix92
Aug 01 2016 01:12
There's a guy on youtube who has ES6 tutorials using bear examples
he's quite obsessed with bears
silver537
@silver537
Aug 01 2016 01:12
lol
@no-stack-dub-sack mainly this one http://exploringjs.com/es6/
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 01:12
haha
Luis Felipe López G.
@luishendrix92
Aug 01 2016 01:12
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 01:12
@silver537 cool, I'll check it out. Thanks!
CamperBot
@camperbot
Aug 01 2016 01:12
no-stack-dub-sack sends brownie points to @silver537 :sparkles: :thumbsup: :sparkles:
:warning: no-stack-dub-sack already gave silver537 points
ElCap
@ElCap
Aug 01 2016 01:12
I'm do the stand in line challenge and I dont really understand what it is asking me to do. can anyone give me a little bettter explanation of what it is asking
Ethan Rose
@ethanrose
Aug 01 2016 01:13
how can I make my regular expression include non-word characters as well as underscores?
return str.toLowerCase().replace(/\W/g, "-");
I can't seem to understand that--
silver537
@silver537
Aug 01 2016 01:13
@aidansven add the underscore after W
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 01:13
@silver537 damn, that looks like some heavy reading
Puvendran Pillay
@puven12
Aug 01 2016 01:13

Can anyone help me with this jasmine test for nodeJS (jasmine-node)?
Here is the function i wanna test

// hello-world.js
function HiWorld(person) {
 return 'hi ' + person;
}
module.exports = HelloWorld;

Here is the spec file

//hello-world-spec.js
var HelloWorld = require('./hello-world');

describe('hi one', function() {
    it('tells hi', function() {
    //    var hello = HelloWorld.HiWorld('bill');
        expect(HiWorld('bill')).toEqual('hi bill');
    });
});

And Here is the error.log when i run $ jasmine-node . in the cmd.exe

Exception loading: C:\Users\Lenovo-PC\exercism\javascript\hello-world\hello-world.spec.js
[ReferenceError: HelloWorld is not defined]
silver537
@silver537
Aug 01 2016 01:14
@no-stack-dub-sack in my opinion, that's the best way to learn anything
Ethan Rose
@ethanrose
Aug 01 2016 01:14
@silver537 I've tried that-- /W_/g
silver537
@silver537
Aug 01 2016 01:14
@aidansven you also need a \ backslash
before the W
W is a meta character and needs an escape. otherwise you're only searching for capital cased w.
Puvendran Pillay
@puven12
Aug 01 2016 01:15
@silver537 do you use babbel for es6?
Ethan Rose
@ethanrose
Aug 01 2016 01:15
/\W_/g
@silver537 ah right thanks
CamperBot
@camperbot
Aug 01 2016 01:15
aidansven sends brownie points to @silver537 :sparkles: :thumbsup: :sparkles:
:cookie: 442 | @silver537 |http://www.freecodecamp.com/silver537
silver537
@silver537
Aug 01 2016 01:15
@aidansven should work now.
Moisés Man
@moigithub
Aug 01 2016 01:15
@puven12 u exporting a HelloWorld >>> module.exports = HelloWorld;
there are any function, variable or anything in ur code named HelloWorld ??
silver537
@silver537
Aug 01 2016 01:16
@puven12 nooooo..... i don't use node.js either.
Ethan Rose
@ethanrose
Aug 01 2016 01:16
@silver537 well it seems to only find results that have a nonword character and an underscore right next to each other
but I want to find the underscore even when there's no nonword character next to it
silver537
@silver537
Aug 01 2016 01:17
but that should work. 0.o
post your code.
Puvendran Pillay
@puven12
Aug 01 2016 01:18
@moigithub so what should be changed in my code?
@moigithub isn't suppose to be the module.exports
Ethan Rose
@ethanrose
Aug 01 2016 01:18
@silver537

function spinalCase(str) {



  return str.toLowerCase().replace(/\W\_/g, "-");
}
Moisés Man
@moigithub
Aug 01 2016 01:18
@puven12 u didnt answer the question yet
silver537
@silver537
Aug 01 2016 01:18
don't use the backslash for your underscore @aidansven
Puvendran Pillay
@puven12
Aug 01 2016 01:18
@moigithub no there is not
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 01:20
@luishendrix92 haha, just got to the bears, that is quite humorous lol
Ethan Rose
@ethanrose
Aug 01 2016 01:20
@silver537 it still appears to be doing the same thing :/
function spinalCase(str) {



  return str.toLowerCase().replace(/\W_/g, "-");
}
silver537
@silver537
Aug 01 2016 01:20
oooh.. hmmm
spinal case?
right
Ethan Rose
@ethanrose
Aug 01 2016 01:21
what do I have to do to make it look for nonword characters and underscores separately? rather than now, it's looking for only instances that are right next to each other
yeah that's the algorithm that I'm on :D
silver537
@silver537
Aug 01 2016 01:21
well you can use the \s to look for all white spaces
Ethan Rose
@ethanrose
Aug 01 2016 01:22
I've tried studying the regexps but I can't seem to figure out :/
silver537
@silver537
Aug 01 2016 01:22
and capture objects using parenthesis with specifications
like ([a-z]) will only look for lower cased letters and you can manipulate those letter by using $1 in your replace.
Ethan Rose
@ethanrose
Aug 01 2016 01:23
@silver537 AH! I figured it out!!!!
@silver537 I wasn't using the "or" operator!!!!
/\W|_/g
Puvendran Pillay
@puven12
Aug 01 2016 01:24
@moigithub so i have commented out the var HelloWorld.. and the module.exports =... and this is the result in the error.log
F

Failures:

  1) hi one tells hi
   Message:
     ReferenceError: HiWorld is not defined
   Stacktrace:
     ReferenceError: HiWorld is not defined
    at null.<anonymous> (C:\Users\Lenovo-PC\exercism\javascript\hello-world\hello-world.spec.js:7:10)

Finished in 0.008 seconds
1 test, 1 assertion, 1 failure, 0 skipped
silver537
@silver537
Aug 01 2016 01:24
or you could do /[\W][_]/g
@aidansven
Ethan Rose
@ethanrose
Aug 01 2016 01:25
@silver537 ohhh ok ok interesting
is there a best practice?
well I guess [ ] if you need a lot of characters rather than putting a ton of "or" operators
silver537
@silver537
Aug 01 2016 01:26
Ethan Rose
@ethanrose
Aug 01 2016 01:27
@silver537
/[\W_]/g
that seems to have gotten it working :)
silver537
@silver537
Aug 01 2016 01:27
you ca nuse the same concepts to input - in between words
Ethan Rose
@ethanrose
Aug 01 2016 01:27
ah ok cool.. I will read that now.. thank you!!
silver537
@silver537
Aug 01 2016 01:27
lol once you're done ill show you my code. :P
Ethan Rose
@ethanrose
Aug 01 2016 01:28
@silver537 haha sounds good ;)
Joseph
@revisualize
Aug 01 2016 01:30
Greetings.
silver537
@silver537
Aug 01 2016 01:30
@revisualize whats goin on?
Joseph
@revisualize
Aug 01 2016 01:31
@silver537 Not much. Drinking a Frapp from Starsmucks and waiting on some food.
silver537
@silver537
Aug 01 2016 01:31
starsmucks?
Joseph
@revisualize
Aug 01 2016 01:31
Starsmucks Caffe
You know the Caffe place with the mermaid logo?
They're everywhere.
silver537
@silver537
Aug 01 2016 01:32
i only know of starbucks
Joseph
@revisualize
Aug 01 2016 01:32
Yeah that.
silver537
@silver537
Aug 01 2016 01:32
but it's not called starsmucks.........
Puvendran Pillay
@puven12
Aug 01 2016 01:33
@moigithub let me look into that
Joseph
@revisualize
Aug 01 2016 01:33
Starsmucks.. Starsucks.. Whatever.
silver537
@silver537
Aug 01 2016 01:34
lol!
Joseph
@revisualize
Aug 01 2016 01:35
My food!
silver537
@silver537
Aug 01 2016 01:35
im hungry
Joseph
@revisualize
Aug 01 2016 01:35
So am I.
Zina Astafyeva
@tragetraje
Aug 01 2016 01:39
Hi all, i'm working on Caesars Cipher.. Can anybody help me understand the method String.fromCharCode()?
silver537
@silver537
Aug 01 2016 01:39
google ASCII codes
String.fromCharCode(65) will return A
Zina Astafyeva
@tragetraje
Aug 01 2016 01:40
I know but how would I transform an array of unicode symbols into a string..
silver537
@silver537
Aug 01 2016 01:41
iterate through, then join into a string.
Zina Astafyeva
@tragetraje
Aug 01 2016 01:41
I've tried that and it doesn't work on some reason....
function test(arr) {
  for (var i = 0; i < arr.length; i++) {
    arr = String.fromCharCode(i);
  }

  return arr;
}

console.log(test([ 83, 69, 82, 82, 32, 80, 66, 81, 82, 32, 80, 78, 90, 67 ]));
Joseph
@revisualize
Aug 01 2016 01:41
Let me try that.
Stephen James
@sjames1958gm
Aug 01 2016 01:42
@tragetraje i is just the index you need arr[i] and you are overwriting arr with a single character.
Joseph
@revisualize
Aug 01 2016 01:42
@tragetraje You're doing =
You're overwriting your whole array each time.
Stephen James
@sjames1958gm
Aug 01 2016 01:42
@tragetraje You need something like var str = ""; then add the chars to the end and return str
Joseph
@revisualize
Aug 01 2016 01:44
@tragetraje Try this:
function test(arr) {
  for (var i = 0; i < arr.length; i++) {
    arr[i] = String.fromCharCode(arr[i]);
  }

  return arr;
}

console.log(test([ 83, 69, 82, 82, 32, 80, 66, 81, 82, 32, 80, 78, 90, 67 ]));
Zina Astafyeva
@tragetraje
Aug 01 2016 01:44
@sjames1958gm @revisualize ok..i see, thanks guys!! :+1:
CamperBot
@camperbot
Aug 01 2016 01:44
tragetraje sends brownie points to @sjames1958gm and @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 2255 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
:star2: 1532 | @revisualize |http://www.freecodecamp.com/revisualize
Joseph
@revisualize
Aug 01 2016 01:44
I sure hope that wasn't a challenge. I just gave away the answer.
Zina Astafyeva
@tragetraje
Aug 01 2016 01:45
@revisualize tiny part of a challenge
silver537
@silver537
Aug 01 2016 01:45
thats what happens when you dont do the challenges!!!!
Joseph
@revisualize
Aug 01 2016 01:46
Which?
Caeser?
Zina Astafyeva
@tragetraje
Aug 01 2016 01:46
yep
Joseph
@revisualize
Aug 01 2016 01:47
@tragetraje You do realize that you're previous code was working as you wrote it.
Zina Astafyeva
@tragetraje
Aug 01 2016 01:47
@revisualize what do you mean? :/
Joseph
@revisualize
Aug 01 2016 01:48
@tragetraje Because you were getting the ascii code for i ... it was outputing this:
[ '\u0000',
  '\u0001',
  '\u0002',
  '\u0003',
  '\u0004',
  '\u0005',
  '\u0006',
  '\u0007',
  '\b',
  '\t',
  '\n',
  '\u000b',
  '\f',
  '\r' ]
Zina Astafyeva
@tragetraje
Aug 01 2016 01:48
it wasn't
Joseph
@revisualize
Aug 01 2016 01:48
It was working. It just wasn't what you intended.
Ethan Rose
@ethanrose
Aug 01 2016 01:48
@silver537 making progress, now my only problem is I get a "-" at the beginning of the string if the first letter was caps haha!
```
  return str.replace(/[A-Z]/g, "-" + "$&").toLowerCase().replace(/\W|_/g, "-").replace(/--/g, "-");
  return str.replace(/[A-Z]/g, "-" + "$&")
.toLowerCase().replace(/\W|_/g, "-")
.replace(/--/g, "-");
it's a long line :D ha
Zina Astafyeva
@tragetraje
Aug 01 2016 01:50
@revisualize aa..ok...not sure already with this atom runner i've started to use instead of repl.it...in some cases it just doesn't show me any output and i don't know why...
Joseph
@revisualize
Aug 01 2016 01:50
I use repl.it
Zina Astafyeva
@tragetraje
Aug 01 2016 01:51
atom runner is kind of faster and runs on your local machine..
but probably i don't know how to use it properly...
Joseph
@revisualize
Aug 01 2016 01:51
I use my work computer when I'm out and about. I don't want to install stuff that I don't need for work.
silver537
@silver537
Aug 01 2016 01:52
@aidansven if you look in the docs it say you can manipulate regex capture objects
/([a-z])/ inthe the reduce method but using the dollar sign and the number of what was first when you declared the object
Joseph
@revisualize
Aug 01 2016 01:52
Also, using a Microsoft Surface Pro 4 kind of sucks for dev wwork.
Zina Astafyeva
@tragetraje
Aug 01 2016 01:52
i see, that's not the case for me and it's just a small plugin for a tool i like (atom)
silver537
@silver537
Aug 01 2016 01:52
@aidansven for in the case of ([a-z]) you will use $1
Zina Astafyeva
@tragetraje
Aug 01 2016 01:52
i've switched to everything mac about a year ago and never looked back :)
silver537
@silver537
Aug 01 2016 01:53
but if you add more you use $1 $2 $3 respectively
chi1289
@chi1289
Aug 01 2016 01:53
hi.... Can I get assistance with a slide show I am working on for JS... it's not working correctly
Joseph
@revisualize
Aug 01 2016 01:53
Well, I'm a Network Systems Administrator III ... So, I kind of have to use a Windows machine for work stuff.
Zina Astafyeva
@tragetraje
Aug 01 2016 01:54
oh, i understand, i'm a kind of Network Engineer willing to switch my career...
Joseph
@revisualize
Aug 01 2016 01:55
You know what.. After I get home. I'm going to take the time to port all of my FreeCodeCamp challenge answers over to Github.
silver537
@silver537
Aug 01 2016 01:55
example if you use (/([a])([A])/g , '$1asdf$2')
you will replace aA with aasdfA
Joseph
@revisualize
Aug 01 2016 01:55
@tragetraje What are you looking at moving into?
silver537
@silver537
Aug 01 2016 01:55
@aidansven $& uses the string you are replacing.
Zina Astafyeva
@tragetraje
Aug 01 2016 01:56
mmm @revisualize not sure exactly but something related with development, not sure what kind of...
if front end, back end...machine learning sounds curious..
Joseph
@revisualize
Aug 01 2016 01:57
Network Engine to Jr. Developer.. Sounds like a crazy pay cut to me.
Zina Astafyeva
@tragetraje
Aug 01 2016 01:58
i know but i enjoy it more and here in the place where i live there are more jobs for programmers...
Joseph
@revisualize
Aug 01 2016 02:00
Same for me.
Ethan Rose
@ethanrose
Aug 01 2016 02:01
@silver537
function spinalCase(str) {
// thank you @silver537 for your hints ;)


var replaced = str.replace(/[A-Z]/g, "-" + "$&").toLowerCase().replace(/\W|_/g, "-").replace(/--/g, "-");
  if (replaced.charAt(0) == "-"){
    return replaced.replace(/-/, "");
  }
  return replaced;
}

spinalCase('This Is Spinal Tap');
CamperBot
@camperbot
Aug 01 2016 02:01
aidansven sends brownie points to @silver537 :sparkles: :thumbsup: :sparkles:
:warning: aidansven already gave silver537 points
Zina Astafyeva
@tragetraje
Aug 01 2016 02:01
ok, and i hope i still have time to grow from jr to not so junior in short period :) @revisualize
though i get discouraged when i see 20 yo programmers with 10 years of experience lol
silver537
@silver537
Aug 01 2016 02:02
@aidansven that passes?
Ethan Rose
@ethanrose
Aug 01 2016 02:02
yeah LOL.. but it's really messy
I'm going to try to work with my $& with $1 like you said and try to clean it up by messing with those
silver537
@silver537
Aug 01 2016 02:04
try /([a-z)([A-Z])/g, '$1-$2'
everytime there's a lowercase followed by an upper case, it will input the -
Ethan Rose
@ethanrose
Aug 01 2016 02:06
@silver537 that did it! :) thanks!!
CamperBot
@camperbot
Aug 01 2016 02:06
aidansven sends brownie points to @silver537 :sparkles: :thumbsup: :sparkles:
:warning: aidansven already gave silver537 points
Ethan Rose
@ethanrose
Aug 01 2016 02:06
function spinalCase(str) {
// thank you @silver537 for your hints ;)

return str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase().replace(/\W|_/g, "-").replace(/--/g, "-");
}
it works.. and I understand regular expressions like 9000% better now.. nice algorithm haha!
actually I got rid of that last unnecessary .replace() now too:
return str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase().replace(/\W|_/g, "-");
silver537
@silver537
Aug 01 2016 02:09
good job
looks just like mine:
return str.replace(/([a-z])([A-Z])/g, '$1-$2').replace(/[\s\W_]/g, '-').toLowerCase();
Ethan Rose
@ethanrose
Aug 01 2016 02:11
ah sweet!!!
silver537
@silver537
Aug 01 2016 02:12
remember \s means all whitespaces
Ethan Rose
@ethanrose
Aug 01 2016 02:12
just a different order for the .toLowerCase() but I guess that doesn't really matter
ahh.. yeah.. and I used \W for all nonword characters
\s might make more sense.. but I guess it depends what else gets passed through the function
either way it works for the FCC tests :)
silver537
@silver537
Aug 01 2016 02:14
always best to input as much cases as possible. lol anyways, good job haha
tony
@tonyg91
Aug 01 2016 02:14
can some one help me with this var myStr="\ \r \n \"; // Change this line I got most of it right but its still asking for myStr should have encoded text with the proper escape sequences and no spacing.
silver537
@silver537
Aug 01 2016 02:15
read the instructions.
they provide you with the text you need to use.
samamsam
@samsamam
Aug 01 2016 02:16

Hello Coders I have a problem on my code
/*
var Car = function() {
this.wheels = 4;
this.engines = 1;
this.seats = 5;
};

// Only change code below this line.

var myCar = new Car();
myCar.wheels = 4;
myCar.turboType = "twin";
for some reason it is not accepting the last line of code as a string value help would be appreciated
/*

silver537
@silver537
Aug 01 2016 02:18
@no-stack-dub-sack hey you still here?
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 02:19
@silver537 yes sir, what's up?
silver537
@silver537
Aug 01 2016 02:19
@no-stack-dub-sack i put both our codes together... INTO ONE LINE!!!
ready??
ready
ready
ready
ready
ready
READY?!?!!??!?!?!?!
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 02:20
@silver537 haha lets see it!
silver537
@silver537
Aug 01 2016 02:20
Binary Agents in one line:
return String.fromCharCode.apply(null, str.split(' ').map(x=>parseInt(x,2)));
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 02:21
now I gotta go test it and see... pretty nice though, you should consider adding it to the help wiki
silver537
@silver537
Aug 01 2016 02:22
idk how....
bluegeek
@bluegeek
Aug 01 2016 02:23
hello world
CamperBot
@camperbot
Aug 01 2016 02:23

welcome to FreeCodeCamp @bluegeek!

bluegeek
@bluegeek
Aug 01 2016 02:23
a robot?
Stephen James
@sjames1958gm
Aug 01 2016 02:23
@bluegeek Hey
silver537
@silver537
Aug 01 2016 02:23
@bluegeek pretty cool isnt he?
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 02:23
@silver537 hey that's pretty solid, lol, nice job
bluegeek
@bluegeek
Aug 01 2016 02:23
yes
samamsam
@samsamam
Aug 01 2016 02:23
@bluegeek hi
bluegeek
@bluegeek
Aug 01 2016 02:23
headimg is pretty
@samsamam hi
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 02:24
@silver537 I just checked actually and a very similar solution is already there - well done though. Makes sense too, wish I thought of that haha
silver537
@silver537
Aug 01 2016 02:24
@no-stack-dub-sack where?
i wanna see it
Stephen James
@sjames1958gm
Aug 01 2016 02:24
@samsamam Which challenge?
the bottom one, it's almost exactly the same except uses the spread operator
silver537
@silver537
Aug 01 2016 02:25
ooooh that is similar.
samamsam
@samsamam
Aug 01 2016 02:25
@sjames1958gm Make Instances of Objects with a Constructor Function in Object Oriented and Functional Programming
Stephen James
@sjames1958gm
Aug 01 2016 02:25
@samsamam To get the challenge to pass - Then give myCar a nickname property with a string value.
silver537
@silver537
Aug 01 2016 02:25
mines better though >:/
Peter Weinberg
@no-stack-dub-sack
Aug 01 2016 02:25
@silver537 haha
Stephen James
@sjames1958gm
Aug 01 2016 02:26
@samsamam The turboType was only a sample
samamsam
@samsamam
Aug 01 2016 02:26
@sjames1958gm i did that myCar.turboType = "twin";
@sjames1958gm so I would need another variable in place of turboType ?
Stephen James
@sjames1958gm
Aug 01 2016 02:27
@samsamam yeah nickname turboType was the example.
samamsam
@samsamam
Aug 01 2016 02:28
@sjames1958gm i tried myCar.color = "green"; still didnt work
scarejar
@scarejar
Aug 01 2016 02:29
If you nest a whileloop inside a for loop, will the while loop run as long as set condition is true infinetly or will it just run the set amount of time specified in the for loop ?
Jaren Escueta
@jarenescueta731
Aug 01 2016 02:30
@scarejar the while loop will run infinitely within the current for loop iteration
samamsam
@samsamam
Aug 01 2016 02:31
@scarejar it will run the while loop go to for loop check again if it satisfies go to while loop and run until satisfies
scarejar
@scarejar
Aug 01 2016 02:31
Something like this :
for(var i = 0; i < 4; i++){

while(true){ /*will this run based on the for loop? or on its own?*/

}

}
Jaren Escueta
@jarenescueta731
Aug 01 2016 02:31
@scarejar that's an infinite loop
scarejar
@scarejar
Aug 01 2016 02:31
ahhh
Stephen James
@sjames1958gm
Aug 01 2016 02:36
@samsamam nickname not color - its in the instructions
Solomon B
@ssbothwell
Aug 01 2016 02:37
Hi guys. I just pasted this in the main channel but it seems pretty busy with some kind of argument about static types.. I'm having trouble with the "Profile Lookup" javascript exercise. I have it mostly working correctly but I cant figure out how to check for a nonexistant firstName value
samamsam
@samsamam
Aug 01 2016 02:38
@sjames1958gm thanks it works
CamperBot
@camperbot
Aug 01 2016 02:38
samsamam sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 2256 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Aug 01 2016 02:38
@samsamam :+1:
@ssbothwell If you have a stack of business cards and are looking for a specific name when do you decide you don't have the card?
Solomon B
@ssbothwell
Aug 01 2016 02:39
after checking the full stack
:)
Stephen James
@sjames1958gm
Aug 01 2016 02:39
@ssbothwell Hint: all code does not have to be in the for loop
Solomon B
@ssbothwell
Aug 01 2016 02:39
makes sense
scarejar
@scarejar
Aug 01 2016 02:39
@ssbothwell if(firstname === "") ? Should check if non existant
Stephen James
@sjames1958gm
Aug 01 2016 02:40
@scarejar He means the firstname is not in the collection
Solomon B
@ssbothwell
Aug 01 2016 02:40
right
scarejar
@scarejar
Aug 01 2016 02:40
ahhh
Stephen James
@sjames1958gm
Aug 01 2016 02:41
@ssbothwell Your for loop should return either the property or the "no such property" only if it finds the name, So if it falls out of the loop, then you didn't find the firstname.
Solomon B
@ssbothwell
Aug 01 2016 02:41
ooh interesting
okay i think that hint might get me to the finish line
gotta take a break but i'll try this later tonight. thanks!
silver537
@silver537
Aug 01 2016 02:42
Search and Replace in one line:
return str.replace(before,(/[A-Z]/.test(str[str.indexOf(before)]))? after[0].toUpperCase()+after.slice(1): after);
Puvendran Pillay
@puven12
Aug 01 2016 02:43
so guys what js proofing do you use?
jslint or jshint or eslint?
silver537
@silver537
Aug 01 2016 02:45
jshint
Puvendran Pillay
@puven12
Aug 01 2016 02:48
@silver537 why hint?
silver537
@silver537
Aug 01 2016 02:48
its the first one i tried and stuck with it
Islam Ibakaev
@dagman
Aug 01 2016 02:57
hey guys quick question when i fetching data in redux should i do it in componentWillMount or ComponentDidMount?
Jacques Thibodeau
@JayThibs
Aug 01 2016 03:12
I find the instructions for "Quoting Strings with Single Quotes" in the javascript section to be a little unclear.
Greg Duncan
@GregatGit
Aug 01 2016 03:31
@JayThibs It is an exercise to show you some of the ways to use " in strings
Darth Skywalker
@adityaparab
Aug 01 2016 03:33
@dagman : I prefer doing it in ComponentDidMount
Islam Ibakaev
@dagman
Aug 01 2016 03:34
@adityaparab in redux or in react
Darth Skywalker
@adityaparab
Aug 01 2016 03:36
Of course, React!
Redux is a state container. :)
chaitanya ashtekar
@chaitanyaashtekar
Aug 01 2016 03:39
@adityaparab PM
Anh Phan
@kemoemo
Aug 01 2016 03:42
i dont know "myStr should have encoded text with the proper escape sequences and no spacing." mean, and my string is "\n\r\abc\"?
and string is "a\n\b\\rc" not correct too
Joseph
@revisualize
Aug 01 2016 03:46
@kemoemo Read the instructions. What should your string be??
Norvin Burrus
@ndburrus
Aug 01 2016 03:47
@kemoemo
ok, we need to take the given string, here:
"FirstLine newline backslash SecondLine backslash carriage-return ThirdLine" (ignore the spacing) and replace the appropriate text (bold words) with the escape coding (use the Code/Output chart)...
Anh Phan
@kemoemo
Aug 01 2016 03:49
oh, thanks. i imagined that whatever string's ok with conditions
Sergo Márquez
@samdsmx
Aug 01 2016 04:00
Hello, someone can teel me why chash my program if iterate the arra of objects with for ... in?
for (var register in collection){
where collection is [{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }]
the console.log(register) returns index numbers...
meceyrlx
@MECEYRLX
Aug 01 2016 04:02
hello people. I am new
Sergo Márquez
@samdsmx
Aug 01 2016 04:02
I solve change my code by collection.forEach(function(register){
but I'm intriged..
raditya putranto
@radityaputranto
Aug 01 2016 04:02
hello
i want ask about jvascript chapter
nextInLine([], 1) should return 1
nextInLine(2, 1) should return 2
nextInLine([5,6,7,8,9], 1) should return 5
After nextInLine(testArr, 10), testArr[4] should be 10
what mean it?
i 'm confuse about this comand
Darth Skywalker
@adityaparab
Aug 01 2016 04:04
just do return arr.shift()
raditya putranto
@radityaputranto
Aug 01 2016 04:05
cange it to nwa one?
*new
@adityaparab it work's well but in this comand nextInLine([5,6,7,8,9], 1) should return 5 did'nt work

function nextInLine(arr, item) {
  // Your code here
  testArr.push(item);
  return testArr.shift(item);  // Change this line
}

// Test Setup
var testArr = [1,2,3,4,5];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 5)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
this my code
i try to push it and it work
but did in work when "nextInLine([5,6,7,8,9], 1) should return 5"
Viraj Bahulkar
@virajbahulkar
Aug 01 2016 04:11

Strokes Return
1 "Hole-in-one!"
<= par - 2 "Eagle"
par - 1 "Birdie"
par "Par"
par + 1 "Bogey"
par + 2 "Double Bogey"

= par + 3 "Go Home!"

function golfScore(par, strokes) {
// Only change code below this line
if(strokes >= par + 3) {
return "Go Home!";
} else if (strokes >= par + 2) {
return "Double Bogey";
} else if (strokes >= par + 1) {
return "Bogey";
} else if (strokes >= par) {
return "Par";
} else if (strokes >= par - 1) {
return "Birdie";
} else if (strokes <= par - 2) {
return "Eagle";
}
golfScore(4, 1) should return "Hole-in-one!" ???
Not getting...
raditya putranto
@radityaputranto
Aug 01 2016 04:13
@virajbahulkar use (```) bro if copy your code in room chat
br3ntor
@br3ntor
Aug 01 2016 04:13
I'm trying to get a sound to play when a picture is clicked. Can anyone tell me why the code I have commented out isn't giving me the same results as the line below it?
$(document).ready(function() {
    $('#test').click(function() {
        // $('#skrill').play();
        document.getElementById('skrill').play();
    });
});
Adam Rolfson
@DarthChowder
Aug 01 2016 04:14
@virajbahulkar The order of your statements matters. You want to have the lowest par values first.
It will stop on the first argument that it resolves to be true.
raditya putranto
@radityaputranto
Aug 01 2016 04:16
@DarthChowder can you help me ?

function nextInLine(arr, item) {
  // Your code here
  testArr.push(item);
  return arr.shift(item);  // Change this line
}

// Test Setup
var testArr = [1,2,3,4,5];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 5)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
Adam Rolfson
@DarthChowder
Aug 01 2016 04:18
@radityaputranto what lesson was that one?
I can’t remember what I did
raditya putranto
@radityaputranto
Aug 01 2016 04:21
@DarthChowder nextInLine([], 1) should return 1
nextInLine(2, 1) should return 2
nextInLine([5,6,7,8,9], 1) should return 5
After nextInLine(testArr, 10), testArr[4] should be 10
i am correct in poin 2 and 3
but its wrong in 1 and 4
Adam Rolfson
@DarthChowder
Aug 01 2016 04:23

@radityaputranto I think if you use

arr.push(item);

That it will work.

wowcallmia
@wowcallmia
Aug 01 2016 04:23
im not sure why there is whitespace in my calculator
when numbers are clicked =[
Adam Rolfson
@DarthChowder
Aug 01 2016 04:24
@radityaputranto obviously leave your return statement in the code as well.
raditya putranto
@radityaputranto
Aug 01 2016 04:25
@DarthChowder oh thank you ,its work :smile:
CamperBot
@camperbot
Aug 01 2016 04:25
radityaputranto sends brownie points to @darthchowder :sparkles: :thumbsup: :sparkles:
:cookie: 199 | @darthchowder |http://www.freecodecamp.com/darthchowder
Adam Rolfson
@DarthChowder
Aug 01 2016 04:25
@br3ntor Did that help out?
@radityaputranto You’re welcome. That part tripped me up when I did it.
raditya putranto
@radityaputranto
Aug 01 2016 04:27
it's mean like we push new a number and we add a new number in this array ,that it right with my argument for this lesson? @DarthChowder
scarejar
@scarejar
Aug 01 2016 04:28

Don't get what Int. Alg "Drop it" wants me to do...

dropElements([0, 1, 0, 1], function(n) {return n === 1;})    // should return [1, 0, 1].

Writing out the function I get [1,1] for obvious reasons but why does it want me to grab the "0" .. when the instructions were
"The second argument, func, is a function you'll use to test the first elements of the array to decide if you should drop it or not."

Adam Rolfson
@DarthChowder
Aug 01 2016 04:28
@radityaputranto yes, that is what we are doing in that lesson.
raditya putranto
@radityaputranto
Aug 01 2016 04:31
@DarthChowder and what mean about comand JSON.stringfy()
DJ
@qualitymanifest
Aug 01 2016 04:37
@scarejar basically you remove elements off the front of the array, until the function (the second argument) returns true
so it looks at [0, 1, 0 ,1]. first up, take the 0. run it against the function. is 0 === 1? no. so you drop the zero
then you have 1, 0, 1. so, take the next first number, the 1. is 1 === 1 ? yes. so you return the remaining array
Jacques Thibodeau
@JayThibs
Aug 01 2016 04:38
@GregatGit Yeah, I understood that, but it seems like there is more than one way of solving it and the exercise only allowed 1 specific solution. Maybe I missed something, but I had to play around with the different combinations until I got the right one.
bluegeek
@bluegeek
Aug 01 2016 04:39
what time is it?
Jacques Thibodeau
@JayThibs
Aug 01 2016 04:39
@bluegeek depends on your timezone? lol
bluegeek
@bluegeek
Aug 01 2016 04:40
so I want to know your timezone
mine is GMT+8
@JayThibs
DJ
@qualitymanifest
Aug 01 2016 04:41
GMT-7
Jacques Thibodeau
@JayThibs
Aug 01 2016 04:42
GMT-4 (1:42 AM)
bluegeek
@bluegeek
Aug 01 2016 04:43
why not go to sleep?
Jacques Thibodeau
@JayThibs
Aug 01 2016 04:44
@bluegeek I'm about to, but I'm working on my thesis.
bluegeek
@bluegeek
Aug 01 2016 04:45
good boy
raditya putranto
@radityaputranto
Aug 01 2016 04:46
i am in GMT +7 :smile:
(11:46 AM)
bluegeek
@bluegeek
Aug 01 2016 04:46
My English is poor,so communicating with you is hard
sherlockbonez
@sherlockbonez
Aug 01 2016 04:46
hey guys I'm having a little trouble with the "selecting from many options with Switch Statements," can I get a little help?
bluegeek
@bluegeek
Aug 01 2016 04:47
Maybe yes
@sherlockbonez
I can see where you are from,and you ?
sherlockbonez
@sherlockbonez
Aug 01 2016 04:49

function caseInSwitch(val) {
var answer = "";
// Only change code below this line
case 1:
answer = "Alpha";
break;
case 2:
answer = "Beta";
break;
case 3:
answer = "Gamma";
break;
case 4:
answer = "Delta";

// Only change code above this line
return answer;
}

// Change this value to test
caseInSwitch(1);

sorry I don't know how to screen shot like everyone else
bluegeek
@bluegeek
Aug 01 2016 04:51
@sherlockbonez I do not understand what is your question
Baskoro Indrayana
@baskoroi
Aug 01 2016 04:51
@sherlockbonez you forgot to enclose the cases in a switch statement, and also the break statement on case 4
samamsam
@samsamam
Aug 01 2016 04:52
@radityaputranto hi
Baskoro Indrayana
@baskoroi
Aug 01 2016 04:52
and pay attention to the capitalization from the Instructions of the exercise. That also matters... I've ever meddled around for minutes just because of wrong caps. :(
sherlockbonez
@sherlockbonez
Aug 01 2016 04:53
okay ill trty that
Baskoro Indrayana
@baskoroi
Aug 01 2016 04:53
okay @sherlockbonez
bluegeek
@bluegeek
Aug 01 2016 04:55
blob
@sherlockbonez

support markdown it is a surprise

sherlockbonez
@sherlockbonez
Aug 01 2016 04:58
@baskoroi yeah it didn't work
this is what I got from what you said

function caseInSwitch(val) {
var answer = "";
// Only change code below this line
case (1):
answer = "Alpha";
break;
case (2):
answer = "Beta";
break;
case (3):
answer = "Gamma";
break;
case (4):
answer = "Delta";
break;

// Only change code above this line
return answer;
}

// Change this value to test
caseInSwitch(1);

bluegeek
@bluegeek
Aug 01 2016 04:59
@sherlockbonez see my screenshot
Joseph
@revisualize
Aug 01 2016 04:59
@sherlockbonez You don't have a switch. YOu just have case's.
Baskoro Indrayana
@baskoroi
Aug 01 2016 04:59
Wait... not like that.
bluegeek
@bluegeek
Aug 01 2016 04:59
@sherlockbonez it works on my computer well
last break is not necessary
Baskoro Indrayana
@baskoroi
Aug 01 2016 05:00
fcc-help-1.PNG
bluegeek
@bluegeek
Aug 01 2016 05:01
the same as mine @baskoroi
Baskoro Indrayana
@baskoroi
Aug 01 2016 05:02
yes i know, i also want him to focus on the switch statement (hence no cases inside)
bluegeek
@bluegeek
Aug 01 2016 05:02
you need a key named "switch"
sherlockbonez
@sherlockbonez
Aug 01 2016 05:03
@baskoroi @bluegeek thank you both. I was being errorsome due to it being late and my lack of sleep
CamperBot
@camperbot
Aug 01 2016 05:03
:warning: could not find receiver for bluegeek
:cookie: 208 | @baskoroi |http://www.freecodecamp.com/baskoroi
sherlockbonez sends brownie points to @baskoroi and @bluegeek :sparkles: :thumbsup: :sparkles:
bluegeek
@bluegeek
Aug 01 2016 05:03
function caseInSwitch(val) {
var answer = "";
// Only change code below this line
switch (val) {
    case 1:
        answer = "Alpha";
        break;
    case 2:
        answer = "Beta";
        break;
    case 3:
        answer = "Gamma";
        break;
    case 4:
        answer = "Delta";
        // Only change code above this line
}

    return answer;
}
// Change this value to test
console.log(caseInSwitch(1));
console.log(caseInSwitch(4));
console.log(caseInSwitch(3));
like this
sherlockbonez
@sherlockbonez
Aug 01 2016 05:03
thanks for giving me the boost I needed to finish this last excersise for the nice.
Baskoro Indrayana
@baskoroi
Aug 01 2016 05:04
^ @bluegeek @sherlockbonez yup, but the first letter in each string shouldn't be in caps, i tried that and the code just didn't work
@sherlockbonez sure you're welcome
bluegeek
@bluegeek
Aug 01 2016 05:12
English is so good,I regret I am not good at it.but it is so hard to study well
Norvin Burrus
@ndburrus
Aug 01 2016 05:13
@bluegeek lesson name?
bluegeek
@bluegeek
Aug 01 2016 05:14
English?
I am not good at English ,the language
Norvin Burrus
@ndburrus
Aug 01 2016 05:14
@bluegeek Alpha should be alpha, etc. :sparkles:
what is your language?
bluegeek
@bluegeek
Aug 01 2016 05:15
it is not my mother tongue.
@ndburrus
Norvin Burrus
@ndburrus
Aug 01 2016 05:15
@bluegeek ok, espanol? duetsche? francais?
these may be helpful: :sparkles:
bluegeek
@bluegeek
Aug 01 2016 05:18
@ndburrus Thank you very much
CamperBot
@camperbot
Aug 01 2016 05:18
bluegeek sends brownie points to @ndburrus :sparkles: :thumbsup: :sparkles:
:star2: 1264 | @ndburrus |http://www.freecodecamp.com/ndburrus
Norvin Burrus
@ndburrus
Aug 01 2016 05:19
@bluegeek you're welcome! :+1:
bluegeek
@bluegeek
Aug 01 2016 05:19
@ndburrus Chinese
Norvin Burrus
@ndburrus
Aug 01 2016 05:20
@bluegeek simplified or traditional?
OK,你都非常欢迎!这是我很高兴为您服务! :sparkles:
bluegeek
@bluegeek
Aug 01 2016 05:21
simplified @ndburrus
Joseph
@revisualize
Aug 01 2016 05:21
Woohoo! I am AWESOME!
I'm downloading a "non-downloadable" JavaScript course.
Hashtag-knowing.html.is.awesome
Norvin Burrus
@ndburrus
Aug 01 2016 05:23
@revisualize are we sharing?
Joseph
@revisualize
Aug 01 2016 05:24
I signed up for a free course on Introduction to Web Development, June 27th 2016 from Shaw Academy.
bluegeek
@bluegeek
Aug 01 2016 05:24
@ndburrus 其实你的这句话,是不通顺的,In fact, your this sentence is not smooth
Joseph
@revisualize
Aug 01 2016 05:24
Most of the courses have a cost.
They tried to do everything to make the course not downloadable.
Well, they can't when they use Vimeo as their video stream source.
Norvin Burrus
@ndburrus
Aug 01 2016 05:24
@bluegeek ok, i used the google translator.... :(
i'm sorry...
@revisualize that is a riot... :sparkles:
...unbelievable
Joseph
@revisualize
Aug 01 2016 05:25
Cause, if you want to find the video link. You look at the frame source you can find the direct link with token to download the 1080p video directly from Vimeo.
bluegeek
@bluegeek
Aug 01 2016 05:26
@ndburrus yeah .I know.but in China ,google cannot visit
Norvin Burrus
@ndburrus
Aug 01 2016 05:27
@bluegeek the second link was reference.com. but i used the translator (not you). i just transmitted the words... :)
Joseph
@revisualize
Aug 01 2016 05:28
@ndburrus I could always create a fake youtube account and just upload the videos as non-listed.
bluegeek
@bluegeek
Aug 01 2016 05:29
Reading is no problem for me
@ndburrus
ZZPot
@ZZPot
Aug 01 2016 05:30
How to make a cross-domain request via javcascript? I mean, I want to make ant simple request, without any cookie header and other stuff. Not jsonp or cors.
Norvin Burrus
@ndburrus
Aug 01 2016 05:30
@bluegeek
OK,你都非常欢迎!这是我很高兴为您服务!
bluegeek
@bluegeek
Aug 01 2016 05:30
maybe a little small question @ndburrus
Norvin Burrus
@ndburrus
Aug 01 2016 05:30
@bluegeek ok...
bluegeek
@bluegeek
Aug 01 2016 05:31
你都非常欢迎!这是我很高兴为您服务 @ndburrus How to say in English?
Norvin Burrus
@ndburrus
Aug 01 2016 05:33
@bluegeek
You are very welcome! I'm glad to be of service!
The translator added 2 extra words - I removed them :)
can you access one of the translators?
bluegeek
@bluegeek
Aug 01 2016 05:35
你很受欢迎,很高兴为您服务
@ndburrus
we have translators too @ndburrus
Norvin Burrus
@ndburrus
Aug 01 2016 05:36
@bluegeek
translated: You are very popular, very pleased to serve you :)
bluegeek
@bluegeek
Aug 01 2016 05:36
@ndburrus maybe I should say it made in China (translators)
Norvin Burrus
@ndburrus
Aug 01 2016 05:37
@bluegeek i think your translator is better... :sparkles: (for english-chinese translations)
bluegeek
@bluegeek
Aug 01 2016 05:38
because translator is different ,the result is different?
Thantk you @ndburrus
Norvin Burrus
@ndburrus
Aug 01 2016 05:38
@bluegeek i believe so - because the engines (or language interpretations, etc.) would be different, i guess
bluegeek
@bluegeek
Aug 01 2016 05:38
error @ndburrus
Norvin Burrus
@ndburrus
Aug 01 2016 05:40
@bluegeek well, it's early here 1:40am - i need to grab a few hours sleep!
this was fun!
have a great night or morning or day!!
bluegeek
@bluegeek
Aug 01 2016 05:41
Can I say Good night? @ndburrus
Norvin Burrus
@ndburrus
Aug 01 2016 05:41
@bluegeek yes, good night! nice to meet you, and we'll see you soon!
bluegeek
@bluegeek
Aug 01 2016 05:41
@ndburrus here is noon
Norvin Burrus
@ndburrus
Aug 01 2016 05:41
@bluegeek ok, have a great afternoon :)
bluegeek
@bluegeek
Aug 01 2016 05:42
Thank you and have a great night @ndburrus
CamperBot
@camperbot
Aug 01 2016 05:42
bluegeek sends brownie points to @ndburrus :sparkles: :thumbsup: :sparkles:
:warning: bluegeek already gave ndburrus points
Norvin Burrus
@ndburrus
Aug 01 2016 05:42
@bluegeek you're welcome! anytime!
Reinier Blanco-Diaz
@reycuban
Aug 01 2016 05:45
hello world.
CamperBot
@camperbot
Aug 01 2016 05:45

welcome to FreeCodeCamp @reycuban!

ZZPot
@ZZPot
Aug 01 2016 05:46
ow to make a cross-domain request via javcascript? I mean, I want to make ant simple request, without any cookie header and other stuff. Not jsonp or cors.
Reinier Blanco-Diaz
@reycuban
Aug 01 2016 05:46
i am new to this, i want to become a developer
bluegeek
@bluegeek
Aug 01 2016 05:46
welcome
@ZZPot I only know jsonp can do this
ZZPot
@ZZPot
Aug 01 2016 05:47
@bluegeek server doesn't support jsonp
it's just a website
bluegeek
@bluegeek
Aug 01 2016 05:48
website?
@ZZPot
ZZPot
@ZZPot
Aug 01 2016 05:48
yep
with data
without websocket, jsonp or cors
it's old
John Freeborn
@jfx1026
Aug 01 2016 05:49
hi all - I'm struggling with the 'Profile Lookup' lesson
My code so far - what a mess I've made...
//Setup
var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intriguing Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    }
];

function lookUpProfile(firstName, prop){
// Only change code below this line
  var x = 0;

  for (x = 0; x < contacts.length; x++) {

    var testName = contacts.hasOwnProperty(firstName[x]);
    var testProp = contacts.hasOwnProperty(prop[x]);

    if (testName===true && testProp===true) {
      return "Something";
    }  

    if (testName===false) {

      if (testName===false && testProp===false) {
        return "No such property";
      }
      return "No such contact";

    } else {
      return contacts[x];
    }

  }
// Only change code above this line
}

// Change these values to test your function
lookUpProfile("Harry", "number");
ZZPot
@ZZPot
Aug 01 2016 05:52
var testName = contacts.hasOwnProperty(firstName[x]); - you checking for property named by first letter of the name
John Freeborn
@jfx1026
Aug 01 2016 05:53
no @ZZPot - I was trying to cycle through the array
ZZPot
@ZZPot
Aug 01 2016 05:53
also, you should check objects, not array
get an object from array and check it for firstName. If it ===, then check for existence of property
John Freeborn
@jfx1026
Aug 01 2016 05:55
can you explain the difference between an object and an array
bluegeek
@bluegeek
Aug 01 2016 05:55
@jfx1026
//Setup
var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intriguing Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    }
];

function lookUpProfile(firstName, prop){
// Only change code below this line
  var x = 0;
  // console.log(contacts);
  for (x = 0; x < contacts.length; x++) {

    var testName = contacts[x].hasOwnProperty("firstName");
    var testProp = contacts[x].hasOwnProperty("prop");

    if (testName===true && testProp===true) {
      return "Something";
    }

    if (testName===false) {

      if (testName===false && testProp===false) {
        return "No such property";
      }
      return "No such contact";

    } else {
      return contacts[x];
    }

  }
// Only change code above this line
}

// Change these values to test your function
console.log(lookUpProfile("Harry", "number"));
ZZPot
@ZZPot
Aug 01 2016 05:56
@jfx1026 array is many ordered objects
bluegeek
@bluegeek
Aug 01 2016 05:56
you can try my code @jfx1026
ZZPot
@ZZPot
Aug 01 2016 05:56
just heap of objects
copypaste without understandng - I think it bad
John Freeborn
@jfx1026
Aug 01 2016 05:56
thanks @bluegeek & @ZZPot - I'll give that a whirl and keep at it
CamperBot
@camperbot
Aug 01 2016 05:56
jfx1026 sends brownie points to @bluegeek and @zzpot :sparkles: :thumbsup: :sparkles:
:cookie: 276 | @zzpot |http://www.freecodecamp.com/zzpot
:warning: could not find receiver for bluegeek
bluegeek
@bluegeek
Aug 01 2016 05:57
could not find receiver for bluegeek?what is this?
ZZPot
@ZZPot
Aug 01 2016 05:57
overdose of cookies
thanks @bluegeek test
CamperBot
@camperbot
Aug 01 2016 05:58
zzpot sends brownie points to @bluegeek :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for bluegeek
ZZPot
@ZZPot
Aug 01 2016 05:58
ahaha
bluegeek
@bluegeek
Aug 01 2016 05:58
what is it?
ZZPot
@ZZPot
Aug 01 2016 05:58
maybe it's reserved name
so, we found bug
report someone about that
bluegeek
@bluegeek
Aug 01 2016 05:59
I do not know who I can find to report
blob
e Ierror operation
ZZPot
@ZZPot
Aug 01 2016 06:02
gitter support maybe
Markus Kiili
@Masd925
Aug 01 2016 06:03
@jfx1026 In javaScript, arrays are objects too. Arrays have numeric properties like "0" and "1" that have special meaning as array elements, and some array methods.
Arrays inherit array methods from Array.prototype and also object methods from Object.prototype.
ZZPot
@ZZPot
Aug 01 2016 06:05
We are children of the C
++
John Freeborn
@jfx1026
Aug 01 2016 06:06
this is helpful
is there a way to output to the console? I want to test variable values and console.log doesn't seem to work
Luis Felipe López G.
@luishendrix92
Aug 01 2016 06:09
Also, if you cast Object.keys() to an array it will spit out the indexes lol.
Justice K. Dube
@kazd
Aug 01 2016 06:11
whats wrong with my code

function convert(num) {
var roman="";
var romanNumeral= ["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X","IX","V","IV","I"];
var numbers = [1000,900,500,400,90,50,40,10,9,54, 1];
for(var i=0;i<numbers.length;i++){ while(num>=numbers[i]){
roman =roman + romanNumeral[i];
num = num - numbers[i];
}
}

return roman;
}

convert(36);

ZZPot
@ZZPot
Aug 01 2016 06:12
CM would be 900 + 1000
ou,
bluegeek
@bluegeek
Aug 01 2016 06:13
@jfx1026 you can try nodejs for console output
Markus Kiili
@Masd925
Aug 01 2016 06:14
@kazd You have 54 on the numbers.
@kazd Check the whole numbers array again.
ZZPot
@ZZPot
Aug 01 2016 06:15
in fact you should break number into levels and every process level with it's own set of letters
John Freeborn
@jfx1026
Aug 01 2016 06:15
nodejs - does this work within the lessons?
bluegeek
@bluegeek
Aug 01 2016 06:16
@jfx1026 yes
node jsscript.js
you can get your result @jfx1026
labeebahmad414
@labeebahmad414
Aug 01 2016 06:46
Would anyone help me understand what I am supposed to do in this problem?
According to my understanding if I am given
"chunkArrayInGroups(["a", "b", "c", "d"], 2);"
then I should return [["a","b"],["c","d"]].
Is this understanding correct?
Mark Todd
@Knochenmark
Aug 01 2016 06:47
@labeebahmad414 the second parameter is the array length
Justice K. Dube
@kazd
Aug 01 2016 06:48
never mind guys, i figured it out
labeebahmad414
@labeebahmad414
Aug 01 2016 06:49
@Knochenmark Length of smaller array or group that we are supposed to form?
Ivan Aganin
@criativ
Aug 01 2016 06:51
Hello :) Need help with "Binary Agents" exercise
Mark Todd
@Knochenmark
Aug 01 2016 06:51
@labeebahmad414 chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2) should return [[0, 1], [2, 3], [4, 5]]. Means chunk them into arrays with length 2 for example
Ivan Aganin
@criativ
Aug 01 2016 06:51
Do not understand how am i supposed to translate a binary code into something...
labeebahmad414
@labeebahmad414
Aug 01 2016 06:52
@Knochenmark right. Thanks
CamperBot
@camperbot
Aug 01 2016 06:52
labeebahmad414 sends brownie points to @knochenmark :sparkles: :thumbsup: :sparkles:
:cookie: 362 | @knochenmark |http://www.freecodecamp.com/knochenmark
Mark Todd
@Knochenmark
Aug 01 2016 06:52
@labeebahmad414 be aware that there can be a rest like array, that is not full length
@labeebahmad414 chunkArrayInGroups([0, 1, 2, 3, 4, 5], 4) should return [[0, 1, 2, 3], [4, 5]]. this one for example
labeebahmad414
@labeebahmad414
Aug 01 2016 06:53
@Knochenmark interesting.
Mark Todd
@Knochenmark
Aug 01 2016 06:54
@labeebahmad414 youll get that, its not as complicated ;)
Ivan Aganin
@criativ
Aug 01 2016 06:55
"Binary Agents" exercise - help? :)
wap2k
@wap2k
Aug 01 2016 06:59
Word blanks im stuck
and have a lack of punctuation
ayo973
@ayo973
Aug 01 2016 07:00
I'm stuck on Word Blanks as well
kirbyedy
@kirbyedy
Aug 01 2016 07:03
what is word blank ?
ayo973
@ayo973
Aug 01 2016 07:04
@kirbyedy It's an exercise in Basic JavaScript
Markus Kiili
@Masd925
Aug 01 2016 07:04
@criativ parseInt() is good here, because you can choose radix 2.
kirbyedy
@kirbyedy
Aug 01 2016 07:04
ok, so what is the task, and what did you do up till now ?
KonstantinKudelko
@KonstantinKudelko
Aug 01 2016 07:05
Hi guys I can not type in the code area, did you have it?
Luohaibin
@lebron112
Aug 01 2016 07:07
Bold    **bold**
Italics    *italics*
Strikethrough    ~~strikethrough~~
Header    # H1 ## H2 ### H3
item
* item
Blockquote    > blockquote
@somebody (mention)    @somebody
#123 (issue)    #123
Link    [title](http://)
Image    ![alt](http://)
code    `code`
LaTeX    $$LaTeX code$$
var code = "formatted";
``` (shift+enter for line break)
var code = "formatted";
ayo973
@ayo973
Aug 01 2016 07:10
@kirbyedy The task is to make a Mad Lib-style fill-in-the-blank sentence.
"You will need to use string operators to build a new string, result, using the provided variables: myNoun, myAdjective, myVerb, and myAdverb." So far, this is what I have:
KonstantinKudelko
@KonstantinKudelko
Aug 01 2016 07:10
@lebron112 it's for me?
ayo973
@ayo973
Aug 01 2016 07:10

@kirbyedy
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "";
// Your code below this line

result = "I saw a" + myNoun + "which was" + myAdjective + "and it" + myVerb + myAdverb;

// Your code above this line
return result;
}

// Change the words here to test your function
wordBlanks(" cat ", " little ", " hit ", " slowly.");

@kirbyedy and I'm just wondering what else they are looking for
kirbyedy
@kirbyedy
Aug 01 2016 07:11
you have to concatenate only this: myNoun, myAdjective, myVerb, myAdverb
and add spaces between, nothing else
spaces like this: " "
so remove: "I saw a" , "which was","and it"
ayo973
@ayo973
Aug 01 2016 07:12
@kirbyedy Oh OK, that's why the instructions told us to enter additional words into wordBlanks. Thank yoU!!
CamperBot
@camperbot
Aug 01 2016 07:12
ayo973 sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star2: 1311 | @kirbyedy |http://www.freecodecamp.com/kirbyedy
Steph
@tcapre01
Aug 01 2016 07:18

hi guys, can someone walk me through this function?

function gcd (x, y) {
  return (x % y === 0) ? y : gcd(y, x%y);
}

I understand what it's supposed to be doing, but I don't understand what the "? y:gcd(y, x%y)" does or what any of the signs do

raditya putranto
@radityaputranto
Aug 01 2016 07:20
@virajbahulkar i see your previous code
Darth Skywalker
@adityaparab
Aug 01 2016 07:20

@tcapre01 :

(x % y === 0) ? y : gcd(y, x%y)

Is a short hand way of saying

if(x % y  === 0){
    return y;
} else {
    return gcd(y,x%y);
}
? mark is a ternary operator. It's general syntax is
expression ? <this if expression evaluates to be true> : <this if expression evaluates to be false>
Steph
@tcapre01
Aug 01 2016 07:23
@adityaparab ah great, I understand the syntax now- though for the 'else' part in the more detailed bit of code- what exactly is being returned? y and the remainder of x/y?
Darth Skywalker
@adityaparab
Aug 01 2016 07:27
else part will return whatever your gcd function returns
Steph
@tcapre01
Aug 01 2016 07:29
so in the original code does that mean it repeats the function if that's the case?
Darth Skywalker
@adityaparab
Aug 01 2016 07:29
repeats as in?
In original code, it will call the gcd function and return whatever that function returns
Steph
@tcapre01
Aug 01 2016 07:31
so for x and y, if x%y===0 then it simply returns y, otherwise then it continues checks if y%(x%y) ===0 and so on
ayo973
@ayo973
Aug 01 2016 07:31
@kirbyedy Sorry to trouble you again. I'm still on that Word Blank exercise. Do you know how I can complete this requirement in the instructions? "wordBlanks("dog", "big", "ran", "quickly") should contain all of the passed in words separated by non-word characters (and any additional words in your madlib)."
Darth Skywalker
@adityaparab
Aug 01 2016 07:32
@tcapre01 : Correct!
Steph
@tcapre01
Aug 01 2016 07:33
ahah! thank you @adityaparab ! it took awhile to wrap my head around
CamperBot
@camperbot
Aug 01 2016 07:33
tcapre01 sends brownie points to @adityaparab :sparkles: :thumbsup: :sparkles:
:cookie: 435 | @adityaparab |http://www.freecodecamp.com/adityaparab
Steph
@tcapre01
Aug 01 2016 07:33
now to actually get back to that algorithm challenge I'm stuck on... XD
Darth Skywalker
@adityaparab
Aug 01 2016 07:38
:+1:
curok
@curok
Aug 01 2016 07:38

Hey everyone! I'm on Lecture 79 "Writing Javascript in a Separate File", and I'm getting this error "Uncaught ReferenceError: $ is not defined main.js:29" when trying to run the javascript

"alert("Hello from JS!");".

I tried to enclose it by doing this, but it didn't help. Any advice?

"$(document).ready(function () {
alert("Hello from JS!");
});"

Benjam Wondafrash
@BenjamWondafrash
Aug 01 2016 07:38
Are there any difficulty levels defined for Algorithm challenges?
Seems like some Intermed challenges are a lot easier than Basic ones
Darth Skywalker
@adityaparab
Aug 01 2016 07:38
@curok Have you included jQuery file?
curok
@curok
Aug 01 2016 07:40
@adityaparab I have this in my html body: <script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s=" crossorigin="anonymous"></script>
kirbyedy
@kirbyedy
Aug 01 2016 07:41
@ayo973 dont get distracted by the words, if the sentence is not very accurate its fine, as long as you use all your words and spaces
@curok you did not load the jquery library
ayo973
@ayo973
Aug 01 2016 07:42
@kirbyedy I mean like, where exactly should I put the additional words? that are not the myNoun, myAdjective, etc. ??
kirbyedy
@kirbyedy
Aug 01 2016 07:43
just the space, between those words
Darth Skywalker
@adityaparab
Aug 01 2016 07:43
@curok : Try including 2.* version of jquery
is there any specification in your challenge that mentions the jquery url?
curok
@curok
Aug 01 2016 07:45
It's the very first js lesson and he mentions no jquery
@adityaparab I added the jquery after trying to troubleshoot using slack
ayo973
@ayo973
Aug 01 2016 07:46

@kirbyedy So this is what I have now, and it does not accept my answer. How can I fix that?

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "";
// Your code below this line

result = myNoun + "" + myAdjective + "" + myVerb + "" + myAdverb;

// Your code above this line
return result;
}

// Change the words here to test your function
wordBlanks("cat" , "little" , "hit" , "slowly");

Mehul Jindal
@Mehul22
Aug 01 2016 07:48
Write a function nextInLine which takes an array (arr) and a number (item) as arguments. Add the number to the end of the array, then remove the first element of array. The nextInLine function should then return the element that was removed.
Can anyone suggest code for it?
Max Zueff
@IvanBot
Aug 01 2016 07:49
Help me, please. Why CreateJS don't drawing?
var point;
var width = 10;
var height = 20;
var tilesz = 24;
var canvas = document.getElementById("board");
var stage = new createjs.Stage(canvas);

genField();

function genField () {
    point = new createjs.Shape();
    for (var y = 0; y < height; y++) {
        for (var x = 0; x < width; x++) {
                point.graphics.beginStroke("#555");
                point.graphics.drawCircle(x*tilesz, y*tilesz, tilesz);
        }
    }

}
CamperBot
@camperbot
Aug 01 2016 07:49
no wiki entry for: me please why createjs dont drawingvar pointvar canvas documentgetelementbyidboardvar stage new createjsstagecanvasgenfieldfunction genfield point new createjsshapefor var y 0 y height y for var x 0 x width x pointgraphicsbeginstroke555pointgraphicsdrawcirclextilesz ytilesz tilesz
ayo973
@ayo973
Aug 01 2016 07:50
@kirbyedy never mind, I just fixed it. I didn't have spaces between my ""'s. Thank you again
CamperBot
@camperbot
Aug 01 2016 07:50
ayo973 sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:warning: ayo973 already gave kirbyedy points
Jordan Mizrachi
@jmizrachi
Aug 01 2016 08:11
Accessing Nested Objects

// Setup
var myStorage = {
  "car": {
    "inside": {
      "glove box": "maps",
      "passenger seat": "crumbs"
     },
    "outside": {
      "trunk": "jack"
    }
  }
};

// Only change code below this line

var gloveBoxContents =myStorage.car["inside"].maps; // Change this line
Mark Todd
@Knochenmark
Aug 01 2016 08:14
@jmizrachi maps should be glove box with bracket notation
@jmizrachi and you dont really need bracktet notation for inside
Jordan Mizrachi
@jmizrachi
Aug 01 2016 08:15
@Knochenmark var gloveBoxContents= myStorage.car["maps"];
var gloveBoxContents= myStorage.car["maps"];
Mark Todd
@Knochenmark
Aug 01 2016 08:15
@jmizrachi no man
@jmizrachi myStorage.car.inside["glove box"]
Jordan Mizrachi
@jmizrachi
Aug 01 2016 08:15
@Knochenmark thanks!
CamperBot
@camperbot
Aug 01 2016 08:15
jmizrachi sends brownie points to @knochenmark :sparkles: :thumbsup: :sparkles:
:cookie: 363 | @knochenmark |http://www.freecodecamp.com/knochenmark
Mark Todd
@Knochenmark
Aug 01 2016 08:16
@jmizrachi you only need bracket notation for glove box, since theres a white space in the key
Jordan Mizrachi
@jmizrachi
Aug 01 2016 08:17
is bracket notation and dot notation the same?
Vladimir Oscolcov
@dmduelist
Aug 01 2016 08:17
hey guys, can someone recommend a free online source of audio - for alarm clock, that I could use as "src=" for my alarm ?
Mark Todd
@Knochenmark
Aug 01 2016 08:18
@jmizrachi not the same obviously, but they follow the same goal for different usecases
Jordan Mizrachi
@jmizrachi
Aug 01 2016 08:18
could I do
myStorage["car"]["inside"]["glove box"]
Mark Todd
@Knochenmark
Aug 01 2016 08:19
@jmizrachi sure, but not really required for car and inside
@jmizrachi bracket notation is especially useful for that white space issue or if you are using concatinated strings
@jmizrachi or when you want to pass a variable to access a property
Vladimir Oscolcov
@dmduelist
Aug 01 2016 08:21
@jmizrachi is this the format of src I should use ? "http://www.orangefreesounds.com/old-clock-ringing-short/" ?
Jordan Mizrachi
@jmizrachi
Aug 01 2016 08:21
no click on the link and then a specific sound that you like @dmduelist
Marc Droz
@b1tc0de
Aug 01 2016 08:21
man im loving that i can use freecodecamp from my galaxy note 3...anyone else been able to use it in your mobile device?
Jordan Mizrachi
@jmizrachi
Aug 01 2016 08:22
@Knochenmark thanks!
CamperBot
@camperbot
Aug 01 2016 08:22
jmizrachi sends brownie points to @knochenmark :sparkles: :thumbsup: :sparkles:
:warning: jmizrachi already gave knochenmark points
Ivan Aganin
@criativ
Aug 01 2016 08:22
cpould anyone tell me - why my code isn't working? please :)
Vladimir Oscolcov
@dmduelist
Aug 01 2016 08:22
yeah I chose that one for example, how do I src it to the <audio> tag ?
Ivan Aganin
@criativ
Aug 01 2016 08:22
function binaryAgent(str) {
  var split = str.split(" ");
    console.log(split);
    var pushed = [];
    for (var i=0;i<split.length;i++){
        var convertNumbers = pushed.push(parseInt(split[i], 2));    
    }
    var pushed2 = pushed.toString(",");
    var result = String.fromCharCode(pushed2);
    return(pushed2);
}

binaryAgent("01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111");
Jordan Mizrachi
@jmizrachi
Aug 01 2016 08:22
@Knochenmark okay thanks!
CamperBot
@camperbot
Aug 01 2016 08:22
jmizrachi sends brownie points to @knochenmark :sparkles: :thumbsup: :sparkles:
:warning: jmizrachi already gave knochenmark points
Ivan Aganin
@criativ
Aug 01 2016 08:23
The "result" is something i cannot understand :/
Mark Todd
@Knochenmark
Aug 01 2016 08:25
@criativ pushed contains only the charCodes i think
Vladimir Oscolcov
@dmduelist
Aug 01 2016 08:26
@criativ parseInt(split[i], 2) try replacing split[i] with pushed[i]
Mark Todd
@Knochenmark
Aug 01 2016 08:26
@criativ var convertNumbers = pushed.push(parseInt(split[i], 2)); whats the point of converNumbers if you dont use it?
Vladimir Oscolcov
@dmduelist
Aug 01 2016 08:26
split.length with pushed.length
@criativ split.length with pushed.length
Ivan Aganin
@criativ
Aug 01 2016 08:27
The idea was to make an array of numbers, witch THEN be converted into letters
Mark Todd
@Knochenmark
Aug 01 2016 08:27
@dmduelist thats wrong
@criativ convert them directly in your for loop and push them into pushed
Fiyin-Anne
@Fiyin-Anne
Aug 01 2016 08:27

// Setup
function phoneticLookup(val) {
var result = "";

// Only change code below this line
"alpha" :"Adams",
"bravo": "Boston",
"charlie":"Chicago",
"delta":"Denver",
"echo": "Easy",
"foxtrot":"Frank"
// Only change code above this line
return result;
}

// Change this value to test
phoneticLookup("charlie");

Mark Todd
@Knochenmark
Aug 01 2016 08:27
@criativ right now you push the charCodes and dont convert them
Ivan Aganin
@criativ
Aug 01 2016 08:28
@Knochenmark hmmmm
Vladimir Oscolcov
@dmduelist
Aug 01 2016 08:28
@Knochenmark there is no point in giving him the solution, is it ?
Mark Todd
@Knochenmark
Aug 01 2016 08:29
@criativ pushed.push( String.fromCharCode(parseInt(split[i], 2)));
Vladimir Oscolcov
@dmduelist
Aug 01 2016 08:29
@Knochenmark but yes you are right. I was wrong )
Mark Todd
@Knochenmark
Aug 01 2016 08:29
@dmduelist well its not helpful to give him wrong ideas, is it?
Vladimir Oscolcov
@dmduelist
Aug 01 2016 08:30
@Knochenmark yes, it isn't
Ivan Aganin
@criativ
Aug 01 2016 08:31
This is even better
:)
Mark Todd
@Knochenmark
Aug 01 2016 08:32
@criativ var charCode = parseInt(bin,2).toString(10); i used this, bin is the actual element ie. your split[i]
Dany Din
@danydin
Aug 01 2016 08:32
@jmizrachi bro
Mark Todd
@Knochenmark
Aug 01 2016 08:33
@criativ in the end you just want to use .join("") to combine your pushed array
Ivan Aganin
@criativ
Aug 01 2016 08:34
@Knochenmark thanks for the help... basicly my idea was correct, only I missed some parts :)
CamperBot
@camperbot
Aug 01 2016 08:34
criativ sends brownie points to @knochenmark :sparkles: :thumbsup: :sparkles:
:cookie: 364 | @knochenmark |http://www.freecodecamp.com/knochenmark
Ivan Aganin
@criativ
Aug 01 2016 08:34
as usual...
sampson
@samourai18
Aug 01 2016 08:34
guys please help with this code

function testLogicalAnd(val) {
// Only change code below this line

if (val > 6 && val < 15 ) {

  return "Yes";

}

// Only change code above this line
return "No";
}

// Change this value to test
testLogicalAnd(10);

Mark Todd
@Knochenmark
Aug 01 2016 08:35
@criativ youre welcome. I think .map would have been interesting for you :P
Ivan Aganin
@criativ
Aug 01 2016 08:36
@Knochenmark I started using map() filter() like 2 days ago... VERY early for me yet... reduce() - is a major headache! :)
x981
@x981
Aug 01 2016 08:36
I have RegExp "^1([0-9]{3})[0-9]{3}-[0-9]{4}$", when match string "1(555)555-5555" result is null, Can you show me where's problem?
Fiyin-Anne
@Fiyin-Anne
Aug 01 2016 08:36

please help with this// Setup
function phoneticLookup(val) {
var result = "";

// Only change code below this line

"alpha":"Adams",

"bravo":"Boston",

"charlie":"Chicago",

"delta":"Denver",

"echo": "Easy",

"foxtrot":"Frank"

// Only change code above this line
return result;
}

// Change this value to test
phoneticLookup("charlie");

Vladimir Oscolcov
@dmduelist
Aug 01 2016 08:36
@criativ I liked how this guy explains reduce(); https://www.youtube.com/watch?v=Wl98eZpkp-c
x981
@x981
Aug 01 2016 08:36
RegExp: "^1([0-9]{3})[0-9]{3}-[0-9]{4}$"
Mark Todd
@Knochenmark
Aug 01 2016 08:37
@criativ map is basically just a for each, where you can map each element
Ivan Aganin
@criativ
Aug 01 2016 08:38
@dmduelist Yeah... I've seen the FFFunction a LOT of times.... and it starts making sense :) but I'm far from grasping the WHOLE idea...
Vladimir Oscolcov
@dmduelist
Aug 01 2016 08:38
@Knochenmark do you by any chance know how to use this audio: http://www.orangefreesounds.com/old-clock-ringing-short/ as a src in audio element ?
Joni petriashvili
@Jonhnwhantcoding
Aug 01 2016 08:38
var myStr = "This is the first sentence.";
myStr += "This is the second sentence.";
could you help me pelase
please
Ivan Aganin
@criativ
Aug 01 2016 08:39
@Jonhnwhantcoding what is it that need to be done here?
Joni petriashvili
@Jonhnwhantcoding
Aug 01 2016 08:39
myStr should have a value of This is the first sentence. This is the second sentence.
This is a an issue
kirbyedy
@kirbyedy
Aug 01 2016 08:39
@x981 maybe to try: \d{3} instead
Ivan Aganin
@criativ
Aug 01 2016 08:41
@Jonhnwhantcoding It does :)
Vladimir Oscolcov
@dmduelist
Aug 01 2016 08:41
@Jonhnwhantcoding what does "return myStr;" give you ?
Ivan
@ivankishko
Aug 01 2016 08:42

@ivankishko
Guys, Hello!!!
How you're doing?
Please, if smbdy know, tell me, why I can't finish challange "Return Largest Numbers in Arrays" with this code:
var maximum = 0;
var neededArr = [];
function largestOfFour(arr) {
for (var i = 0; i < arr.length; i++) {
maximum = Math.max.apply(null, arr[i]);
neededArr.push(maximum);
}
return neededArr;
}

largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]);

Joni petriashvili
@Jonhnwhantcoding
Aug 01 2016 08:44
@criativ we think it does
@criativ but it,s a issue
:D
@dmduelist it give me this
myStr should have a value of This is the first sentence. This is the second sentence.
This is the first sentence.This is the second sentence."
Vladimir Oscolcov
@dmduelist
Aug 01 2016 08:45
@Jonhnwhantcoding var myStr = "This is the first sentence."; myStr += " This is the second sentence.";
Joni petriashvili
@Jonhnwhantcoding
Aug 01 2016 08:46
@dmduelist done thanks
CamperBot
@camperbot
Aug 01 2016 08:46
jonhnwhantcoding sends brownie points to @dmduelist :sparkles: :thumbsup: :sparkles:
:cookie: 328 | @dmduelist |http://www.freecodecamp.com/dmduelist
Vladimir Oscolcov
@dmduelist
Aug 01 2016 08:46
@Jonhnwhantcoding add a space right after " in 'myStr +='
Joni petriashvili
@Jonhnwhantcoding
Aug 01 2016 08:47
@dmduelist what was mistake in my code?
Vladimir Oscolcov
@dmduelist
Aug 01 2016 08:47
@Jonhnwhantcoding add a space right after " in 'myStr +="'
x981
@x981
Aug 01 2016 08:47
@kirbyedy I test the RegExp "^1([0-9]{3})[0-9]{3}-[0-9]{4}$" on website http://regexr.com/, no error. Your regexp has same error return false.
Vladimir Oscolcov
@dmduelist
Aug 01 2016 08:47
the string that was added, was taken literally from you input. So you just needed a space after the period
Dany Din
@danydin
Aug 01 2016 08:48
hey is data-location is a selfmade attribute or?
kirbyedy
@kirbyedy
Aug 01 2016 08:48
@x981 if you are solving the us telephone challenge you have to be aware of the optional characters that are appearing
sometimes you have 1 sometimes no
also with the ( )
sampson
@samourai18
Aug 01 2016 08:49
helo
how do i get pass this challenge
testLogicalAnd(25) should return "Yes"
testLogicalAnd(30) should return "Yes"
testLogicalAnd(50) should return "Yes"
kirbyedy
@kirbyedy
Aug 01 2016 08:49
@x981 also sometimes you have a - and sometimes just a space, so its not the same
Vladimir Oscolcov
@dmduelist
Aug 01 2016 08:49
@criativ btw, sorry that I gave you wrong suggestions on your request. I've solved that problem differently, and rushed with the answer miss-reading your code :)
Dany Din
@danydin
Aug 01 2016 08:50

im trying to figure how:

    $.ajax('/photos.html', {
      data: {
        location: $('#tour').data('location')},

get attached with to show only the correct pic:

<div id="tour" data-location="london">
Ivan Aganin
@criativ
Aug 01 2016 08:51
@dmduelist no problem :)
r2d2
@UsamaHameed
Aug 01 2016 08:51
How do I create html elements using jquery?
Dany Din
@danydin
Aug 01 2016 08:52
@UsamaHameed $('class/id where u want it to be placed at').html('<li></li>');
r2d2
@UsamaHameed
Aug 01 2016 08:53
Would it append at the end? @danydin
of that class/id ?
sampson
@samourai18
Aug 01 2016 08:54
hello no one wants to help me
r2d2
@UsamaHameed
Aug 01 2016 08:54
@samourai18 Not true :P
Dany Din
@danydin
Aug 01 2016 08:54
@UsamaHameed no it will replace it
@UsamaHameed if you want to append theres another method
@samourai18 sry bro im not so much into alogrtiahms :x
x981
@x981
Aug 01 2016 08:55
@kirbyedy i add RegExp to array, then use for loop to check one by one regexp with string argument, is right?
Vladimir Oscolcov
@dmduelist
Aug 01 2016 08:56
@samourai18 what challenge is it ?
kirbyedy
@kirbyedy
Aug 01 2016 08:56
@x981 dont know that
r2d2
@UsamaHameed
Aug 01 2016 08:57
@danydin thanks
CamperBot
@camperbot
Aug 01 2016 08:57
usamahameed sends brownie points to @danydin :sparkles: :thumbsup: :sparkles:
:cookie: 321 | @danydin |http://www.freecodecamp.com/danydin
sampson
@samourai18
Aug 01 2016 08:57
Comparisons with the Logical And Operator
Dany Din
@danydin
Aug 01 2016 08:57
:+1:
sampson
@samourai18
Aug 01 2016 08:57
@dmduelist

function testLogicalAnd(val) {
// Only change code below this line

if (val > 6 && val < 15 ) {

  return "Yes";

}

// Only change code above this line
return "No";
}

// Change this value to test
testLogicalAnd(10);

x981
@x981
Aug 01 2016 08:58
@kirbyedy That is Validate US Telephone Numbers challenge,
Dany Din
@danydin
Aug 01 2016 08:58
@UsamaHameed what are u buildin
kirbyedy
@kirbyedy
Aug 01 2016 08:59
@x981 I tested here: http://regexr.com/
and this line passes: ^1\(\d{3}\)\d{3}-\d{4}$
FM
@mafelix
Aug 01 2016 08:59
hi
x981
@x981
Aug 01 2016 08:59
@kirbyedy Your mean has only regexp for all case us phone number?
FM
@mafelix
Aug 01 2016 08:59
anyone good with js promises?
function getStatus() {
    $.each(twitchList, function(i, stream) {
      promisesStatus.push($.ajax({
            dataType: "json",
            type: "GET",
            url: URL + "/streams/" + stream
      }));
    });
    promisesStatus.forEach(function(promise){
      // console.log(promise);

      var args = Array.prototype.slice.call(arguments);
      promise.then(function(response){
        console.log(response);
      });
      promise.catch(function(err){
        console.log(err)
      })
    })
  }
promise.catch is not a function
:(
kirbyedy
@kirbyedy
Aug 01 2016 09:00
but as I said, for the challenge you have optional ( ) and spaces and -
@x981 that line is not going to pass for : 1 555-555–5555 or 5555555555
or others, so you have to include optional
FM
@mafelix
Aug 01 2016 09:02
can anyone explain why my promise.catch is not a function?
x981
@x981
Aug 01 2016 09:03
@kirbyedy i, see. I use your reg exp "^1(\d{3})\d{3}-\d{4}$" for this string "1(555)555-5555" return false, tested on web regexr.com is true
why?
r2d2
@UsamaHameed
Aug 01 2016 09:05
Working on Wikipedia Viewer. I want to show the ten results from the JSON on the HTML DOM. ANd I would also like to have the next page button at the bottom. @danydin
Dany Din
@danydin
Aug 01 2016 09:06
@UsamaHameed nice gl!
FM
@mafelix
Aug 01 2016 09:07
can anyone explain why my catch for promise is coming back as not a function?
kirbyedy
@kirbyedy
Aug 01 2016 09:07
@x981 no, it works fine
check the image
Screen Shot 2016-08-01 at 12.07.34.png
JavarriL
@JavarriL
Aug 01 2016 09:08
Is there a built - in - object or variable for all real numbers?
Vladimir Oscolcov
@dmduelist
Aug 01 2016 09:09
@samourai18 so what is the problem ?!
r2d2
@UsamaHameed
Aug 01 2016 09:09
thanks @danydin
CamperBot
@camperbot
Aug 01 2016 09:09
usamahameed sends brownie points to @danydin :sparkles: :thumbsup: :sparkles:
:warning: usamahameed already gave danydin points
Vladimir Oscolcov
@dmduelist
Aug 01 2016 09:10
@samourai18 change tihs condition (val > 6 && val < 15 ) so that it would be true
@samourai18 (val > 6 && val < 51 ) like 51
Abis Mal
@abisthecodermal
Aug 01 2016 09:11
Hi all. I need help
Why doesn't this execute?
if(jsonStreamData.hasOwnProperty("error"))
        {
            alert("Account Closed");
        }
jsonstream
{
  "error": "Unprocessable Entity",
  "message": "Channel 'brunofin' is unavailable",
  "status": 422
}
Vladimir Oscolcov
@dmduelist
Aug 01 2016 09:12
@samourai18 did it work ?
x981
@x981
Aug 01 2016 09:14
@kirbyedy Can i use String.Match(regexp) function?
Markus Kiili
@Masd925
Aug 01 2016 09:15
@JavarriL JS has only one Number type. All numbers are 64bit floating point numbers.
kirbyedy
@kirbyedy
Aug 01 2016 09:15
@x981 no idea, try
Dany Din
@danydin
Aug 01 2016 09:15
you cant use jsonstreamdata.hasownproperty]
@manucpp
Abis Mal
@abisthecodermal
Aug 01 2016 09:16
oh...
x981
@x981
Aug 01 2016 09:16
i tried, result as i show you above, perhelp use test().
@kirbyedy
Dany Din
@danydin
Aug 01 2016 09:16
@manucpp what are u trying to do to show a message if the api call has failed?
FM
@mafelix
Aug 01 2016 09:17
are you using async?
I'm having the same problem
Abis Mal
@abisthecodermal
Aug 01 2016 09:17
{
  "error": "Unprocessable Entity",
  "message": "Channel 'brunofin' is unavailable",
  "status": 422
}
JSON received when the user does not exist @danydin
FM
@mafelix
Aug 01 2016 09:17
but my problem is I can't catch the error with promises
can someone take a look at my code plz?
the problem is that
jsonp DOES NOT register error cbs
so you have to use some workaround
Dany Din
@danydin
Aug 01 2016 09:17
@manucpp yes but call it in the error / fail paramter instead.
FM
@mafelix
Aug 01 2016 09:17
which I'm trying to do with promises
are you using jsonp?
@manucpp
Abis Mal
@abisthecodermal
Aug 01 2016 09:18
oh! No I am happy with json @mafelix
should I?
FM
@mafelix
Aug 01 2016 09:18
it's much easier with json
but your app will break
Dany Din
@danydin
Aug 01 2016 09:18
what are u trying to do @mafelix
FM
@mafelix
Aug 01 2016 09:18
I'm trying to catch a promise error
and it's not registering
but i guess I'm doing it in a funny way
Abis Mal
@abisthecodermal
Aug 01 2016 09:19
I use crossorigin.me @mafelix
FM
@mafelix
Aug 01 2016 09:19
want to take a look?
@manucpp what is that?
Abis Mal
@abisthecodermal
Aug 01 2016 09:19
so that you dont have to use jsonp. The seasoned guys here can tell us more
Dany Din
@danydin
Aug 01 2016 09:19
ive not dealt yet with promises on apis but ill have to use it in few days so i doubt i can help u atm :x
FM
@mafelix
Aug 01 2016 09:20
oh
you sly dog
Abis Mal
@abisthecodermal
Aug 01 2016 09:20
something to do with CORS :P
FM
@mafelix
Aug 01 2016 09:20
crossorigin.me might be my solution as well
Abis Mal
@abisthecodermal
Aug 01 2016 09:20
@mafelix
FM
@mafelix
Aug 01 2016 09:20
you're tricking cros
cors
Abis Mal
@abisthecodermal
Aug 01 2016 09:20
yes :P
FM
@mafelix
Aug 01 2016 09:20
by proxying through crossorigin.me
Abis Mal
@abisthecodermal
Aug 01 2016 09:20
yes