These are chat archives for FreeCodeCamp/HelpJavaScript

4th
Nov 2016
Mitch
@MitchWilkins
Nov 04 2016 00:00
so for the Mutation challenge I got every thing to go right except for the current combo. Any ideas ?
function mutation(arr) {

  var lower = arr[0].toLowerCase();
  var lower1 = arr[1].toLowerCase();
  var split = lower1.split('');
  for (var i = 0; i < lower1.length; i++){
    if(lower.indexOf(arr[1][i].toLowerCase()) != -1) {
      return true;
    } 
      return false;

  }

}
mutation(["hello", "hey"]);
Brian
@BrianCodes33
Nov 04 2016 00:00
why are you setting the method in your if?
if you already have it in your variable? also you don’t need to split
Owa Aquino
@owaaquino
Nov 04 2016 00:01
can anyone help me out on my project :D
Maksim Kulichenko
@makstheimba
Nov 04 2016 00:01
@owaaquino yes
__mifflin__
@cdrainxv
Nov 04 2016 00:01
@MitchWilkins: You should only return true; if you have gone through the whole loop and every character in arr[1] was found in arr[2].
Owa Aquino
@owaaquino
Nov 04 2016 00:01
i'm kinda stuck right now on my this http://codepen.io/owaaquino/pen/ORxkgo
Brian
@BrianCodes33
Nov 04 2016 00:01
@ehutchllew i haven’t really started this algorithm...
Owa Aquino
@owaaquino
Nov 04 2016 00:02
@makstheimba the problem is the "Cancel" button in edit mode
it won't work -_-
i don't know why it just said that undefined
this code right here
Mitch
@MitchWilkins
Nov 04 2016 00:03
@BrianCodes33 why not? should I set it to a variable then use it?
Owa Aquino
@owaaquino
Nov 04 2016 00:03

var cancelAction = function(){
var listItem = this.parentNode;
var canceBtn = listItem.querySelector("button.cancel");

var containsClass = listItem.classList.contains("editMode");

listItem.classList.toggle("editMode");

}

var editItem = function(){
var listItem = this.parentNode;
var label = listItem.querySelector("label");
var inputText = listItem.querySelector("input[type=text]");
var saveBtn = listItem.querySelector("button.edit");

var containsClass = listItem.classList.contains("editMode");

if (containsClass) {
    label.innerHTML = inputText.value;    
} else{
    inputText.value = label.innerHTML; 
}

listItem.classList.toggle("editMode");

cancelAction();

}

Brian
@BrianCodes33
Nov 04 2016 00:05
@MitchWilkins you already set your .toLowerCase() variables, you don’t need it in your if
Ismael Barba
@IsmaelBarba
Nov 04 2016 00:05
Challenge is Make Instances of Objects with a Constructor Function

var Car = function() {
   this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car();
myCar.engines = 1;
//Add the property "engines" to myCar, and make it a number.


// Only change code above this line.
(function() {return JSON.stringify(myCar);})();


I need the property nickname of myCar should be a string.
How to make it a string?
Jacob
@jdc101214
Nov 04 2016 00:06
@walidashri thanks
CamperBot
@camperbot
Nov 04 2016 00:06
jdc101214 sends brownie points to @walidashri :sparkles: :thumbsup: :sparkles:
:cookie: 565 | @walidashri |http://www.freecodecamp.com/walidashri
perseusMyk
@perseusMyk
Nov 04 2016 00:07
@IsmaelBarba did you try to add the property as " "?
Ismael Barba
@IsmaelBarba
Nov 04 2016 00:07

yes. Tried this.

var Car = function() {
   this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car();
myCar.engines = "turbo";
//Add the property "engines" to myCar, and make it a number.


// Only change code above this line.
(function() {return JSON.stringify(myCar);})();

But did not work

perseusMyk
@perseusMyk
Nov 04 2016 00:09
@IsmaelBarba ah sorry , it s post to be number , like you did it the first code ''' myCar.engines = 1; '''
CamperBot
@camperbot
Nov 04 2016 00:09
:bulb: to format code use backticks! ``` more info
Owa Aquino
@owaaquino
Nov 04 2016 00:09

```var cancelAction = function(){
var listItem = this.parentNode;
var canceBtn = listItem.querySelector("button.cancel");

var containsClass = listItem.classList.contains("editMode");

listItem.classList.toggle("editMode");

}

var editItem = function(){
var listItem = this.parentNode;
var label = listItem.querySelector("label");
var inputText = listItem.querySelector("input[type=text]");
var saveBtn = listItem.querySelector("button.edit");

var containsClass = listItem.classList.contains("editMode");

if (containsClass) {
    label.innerHTML = inputText.value;    
} else{
    inputText.value = label.innerHTML; 
}

listItem.classList.toggle("editMode");

cancelAction();

}```

ehutchllew
@ehutchllew
Nov 04 2016 00:10
@IsmaelBarba says to make it a number, try changing your value from "turbo" to a number
Owa Aquino
@owaaquino
Nov 04 2016 00:10
sorry didn't meant to do that again.
ehutchllew
@ehutchllew
Nov 04 2016 00:12
@IsmaelBarba also I think you're supposed to make a function of myCar, not a variable.
Ismael Barba
@IsmaelBarba
Nov 04 2016 00:15

@ehutchllew got it

Adding a property to an object can be done through dot-notation. Something like the following will satisfy the final instruction:

myCar.nickname = "Bob Ryan";

so I did this and it worked.

var Car = function() {
   this.wheels = 4;
};

// Only change code below this line.
var myCar = new Car();
myCar.nickname = "Bob Ryan";
//Add the property "engines" to myCar, and make it a number.


// Only change code above this line.
(function() {return JSON.stringify(myCar);})();


Thanks and happy coding!
CamperBot
@camperbot
Nov 04 2016 00:15
ismaelbarba sends brownie points to @ehutchllew :sparkles: :thumbsup: :sparkles:
:cookie: 302 | @ehutchllew |http://www.freecodecamp.com/ehutchllew
trinaclark
@trinaclark
Nov 04 2016 00:24
I need help on lesson "Convert Celsius to Fahrenheit". Anyone?
Johnny
@JohnnyBizzel
Nov 04 2016 00:26
@trinaclark http://www.manuelsweb.com/temp.htm
The instructions should give you the formula...?
Brian
@BrianCodes33
Nov 04 2016 00:34
@MitchWilkins
function mutation(arr) {

  var lower = arr[0].toLowerCase();
  var lower1 = arr[1].toLowerCase();
  console.log(lower);
  console.log(lower1);
  for (var i = 0; i < lower1.length; i++){
    if(lower.indexOf(lower1[i]) < 0) {
      return false;
    } 
      return true;
  }
}
mutation(["hello", "hey"]);
hold on one case isn’t passing
__mifflin__
@cdrainxv
Nov 04 2016 00:41
@MitchWilkins : You need to have return true; outside of your for loop. Refer to this: :point_up: November 3, 2016 6:01 PM
Conor Murphy
@cmurphy580
Nov 04 2016 01:19
does anyone know of a weather api that pulls the time of day? I'm using openweathermap right now.
Kikkamin
@Kikkamin
Nov 04 2016 01:21
Lesson: Quoting Strings with Single Quotes. My answer: var myStr = '<a href="http://www.example.com" target="_blank">Link</a>'; I got the error message: Remove all the backslashes () As anyone can see I have done so. Can someone help me please.
Ryan Williams
@RyWilliams
Nov 04 2016 01:22
@cmurphy580 you can use the javascript Date object
Walid Ashri
@walidashri
Nov 04 2016 01:23
@Kikkamin u need to escape the "
Kikkamin
@Kikkamin
Nov 04 2016 01:25
@walidashri so no double quotes then, only single ones?
Walid Ashri
@walidashri
Nov 04 2016 01:26
@Kikkamin no wait I tested ur code and pass :( my bad
Kikkamin
@Kikkamin
Nov 04 2016 01:26
@walidashri I don't understand.
Walid Ashri
@walidashri
Nov 04 2016 01:27
@Kikkamin '<a href="http://www.example.com" target="_blank">Link</a>' this is right
silver537
@silver537
Nov 04 2016 01:31
^ na ah
@cmurphy580 time of day?
Kikkamin
@Kikkamin
Nov 04 2016 01:31
@walidashri I still get the same error message. And also other error message. I have reset and refreshed my page.
Walid Ashri
@walidashri
Nov 04 2016 01:32
@Kikkamin copy the code
Nelson
@nelruk
Nov 04 2016 01:32
Can someone help me please?
I'm stuck in a exercise Stand in Line
silver537
@silver537
Nov 04 2016 01:33
code or no one helps you
Kikkamin
@Kikkamin
Nov 04 2016 01:33
@walidashri I did copy your code. No help. Same error message.
Nelson
@nelruk
Nov 04 2016 01:33
function nextInLine(arr, item) {
  // Your code here
   nextInLine(arr.pop());
  return item.unshift();  // Change this line
}

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

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
What am I doing wrong?
silver537
@silver537
Nov 04 2016 01:33
everything
Nelson
@nelruk
Nov 04 2016 01:34
What am i doing wrong? More specifically?
Walid Ashri
@walidashri
Nov 04 2016 01:35
@Kikkamin
var myStr = '<a href="http://www.example.com" target="_blank">Link</a>';
Alex Bulanov
@bulanov416
Nov 04 2016 01:35
Hey all. I need some help with the nesting for loops challange
*challenge
Thomas Gerot
@tjgerot
Nov 04 2016 01:35
@nelruk What is it doing at what should it be doing?
Alex Bulanov
@bulanov416
Nov 04 2016 01:35

function multiplyAll(arr) {
var product = 1;
// Only change code below this line
for (var i = 0; i < arr.length; i++ ) {
for (var i2 = 0; i2 < arr[i].lenth; i2++) {
console.log(arr[i][i2]);
}
}
// Only change code above this line
return product;
}

// Modify values below to test your code
multiplyAll([[1],[2],[3]]);

uxdash
@uxdash
Nov 04 2016 01:35
Has anyone done the "counting cards" JS exercise? I'm totally stuck =(
Alex Bulanov
@bulanov416
Nov 04 2016 01:36
this always returns 1
Nelson
@nelruk
Nov 04 2016 01:36
@tjgerot exercise Stand in Line
Alex Bulanov
@bulanov416
Nov 04 2016 01:36
i did the counting cards
i think i can help
uxdash
@uxdash
Nov 04 2016 01:36
Yay!
Let me upload a screenshot
TY
Alex Bulanov
@bulanov416
Nov 04 2016 01:36
private message me the code @uxdash
uxdash
@uxdash
Nov 04 2016 01:36
Ok
Alex Bulanov
@bulanov416
Nov 04 2016 01:36
private message
:)
uxdash
@uxdash
Nov 04 2016 01:36
Hmm, how do I PM here?
@bulanov416 hi
Whoops not that
__mifflin__
@cdrainxv
Nov 04 2016 01:37
@uxdash: hover over a persons’s avatar/pic and click chat privately
uxdash
@uxdash
Nov 04 2016 01:37
Ty
Thanks @cdrainxv
CamperBot
@camperbot
Nov 04 2016 01:38
uxdash sends brownie points to @cdrainxv :sparkles: :thumbsup: :sparkles:
:cookie: 705 | @cdrainxv |http://www.freecodecamp.com/cdrainxv
Sasha
@SashaKoro
Nov 04 2016 01:38
while (myVariable != 1) {
    myVariable = otherFunction(myVariable);
    }
So this has me completely stumped. My expectation is that as long as myVariable does not equal 1, the while look will keep running and putting myVariable into otherFunction. However, the loop only executes only one time. And the code just stops. There is no infinite loop, and the code below the while loop does not execute. Any takers?
Kikkamin
@Kikkamin
Nov 04 2016 01:38
@walidashri I copied the code. I got the following error messages: Remove all the backslashes ()
You should have two single quotes ' and four double quotes "
uxdash
@uxdash
Nov 04 2016 01:38
Oh lol, that only works when you pop out the full screen of gitter
ehutchllew
@ehutchllew
Nov 04 2016 01:38

Constructive criticism is welcome! If you feel like my code is sloppy or w/e, just let me know and give me some advice, thanks :)

http://codepen.io/ehutchllew/pen/ozRkLa/

uxdash
@uxdash
Nov 04 2016 01:38
Chat doesnt show in the embedded gitter
silver537
@silver537
Nov 04 2016 01:42
@ehutchllew keep F in whole numbers.
Ryan Williams
@RyWilliams
Nov 04 2016 01:42
@SashaKoro is your variable defined before the while loop?
ehutchllew
@ehutchllew
Nov 04 2016 01:42
@silver537 alright, one second!
@silver537 k, there we go :)
Also, does anyone know how to get rid of that grayish-white highlight that appears when clicking the button?
Sasha
@SashaKoro
Nov 04 2016 01:43
@RyWilliams It is a global variable
Kikkamin
@Kikkamin
Nov 04 2016 01:43
@walidashri Can you help me?
Ryan Williams
@RyWilliams
Nov 04 2016 01:44
@SashaKoro Does it have any value assigned to it?
Kikkamin
@Kikkamin
Nov 04 2016 01:45
Can anyone help me with Quoting Strings with Single Quotes? I constantly got the following error messages: Remove all the backslashes ()
You should have two single quotes ' and four double quotes " and here is my code: var myStr ='<a href="http://www.example.com" target="_blank">Link</a>';
Sasha
@SashaKoro
Nov 04 2016 01:45
@RyWilliams Yes, the value is the user input, i can actually stick some statements after myVariable = otherFunction(myVariable); and the function does take the variable and runs it
Walid Ashri
@walidashri
Nov 04 2016 01:46
@Kikkamin rest the code and copy it again
João Mhurilo Godoi da Silva
@ebak123
Nov 04 2016 01:46

Hey guys, i'm stuck at lesson 216. My for loop not stack the counter. If i change manually the counter inside the functions, i've the correctly result, but if i let the counter, i get the wrong result.

for (var i=0; i < contacts.length; i++){
if (contacts[i].hasOwnProperty(prop)===false){
return "No such property";
}else if(firstName!==contacts[i].firstName){
return "No such contact";
}else{
return contacts[i][prop];
}
}

the name of lesson is Profile Lookup
Kikkamin
@Kikkamin
Nov 04 2016 01:48
@walidashri I don't understand the word rest. What do you want me to do? Can you be clearer? I have copied the same code about 25 times now . Refreshed the page and reset it as often as I possibly can. I don't know what else I can do.
ehutchllew
@ehutchllew
Nov 04 2016 01:48
@Kikkamin sorry, what are yout rying to do? can you give some more context?
Walid Ashri
@walidashri
Nov 04 2016 01:49
@Kikkamin Sorry meant reset
__mifflin__
@cdrainxv
Nov 04 2016 01:49
@ebak123: You should only return "No such contact"; when you have traversed the whole loop and not found the person you are looking… so you need to return it outside of your loop… you might have to rearrange your code make that work.
João Mhurilo Godoi da Silva
@ebak123
Nov 04 2016 01:50
oh
get it, i'll try
thank you
Kikkamin
@Kikkamin
Nov 04 2016 01:50
@ehutchllew Here is what I try to do: LESSON: Quoting Strings with Single Quotes AND I constantly got the two eror messages: Remove all the backslashes ()
You should have two single quotes ' and four double quotes " and here is my code: var myStr = '<a href="http://www.example.com" target="_blank">Link</a>';I have reset my page and refreshed many, many times. Can you help me?
Conor Murphy
@cmurphy580
Nov 04 2016 01:50
@RyWilliams How would you do that? @silver537 Just the time. Like right now in California its 6:50pm
Ryan Williams
@RyWilliams
Nov 04 2016 01:51
@SashaKoro hmm, have you tried setting the value of the variable inside the function that you're trying to call, rather than assigning it?
Joseph
@revisualize
Nov 04 2016 01:51
Hello.
Kikkamin
@Kikkamin
Nov 04 2016 01:51
@walidashri I have reset an refreshed the page many, many times. Still no help.
Joseph
@revisualize
Nov 04 2016 01:51
@Kikkamin What are you doing?
Kikkamin
@Kikkamin
Nov 04 2016 01:52
@revisualize Here is what I try to do: LESSON: Quoting Strings with Single Quotes AND I constantly got the two eror messages: Remove all the backslashes ()
You should have two single quotes ' and four double quotes " and here is my code: var myStr = '<a href="http://www.example.com" target="_blank">Link</a>';I have reset my page and refreshed many, many times. Can you help me?
Joseph
@revisualize
Nov 04 2016 01:52
@Kikkamin Let me pull it up.
Ryan Williams
@RyWilliams
Nov 04 2016 01:52
@cmurphy580 var d = new Date(); d.getHours(); d.getMinutes();
Walid Ashri
@walidashri
Nov 04 2016 01:52
@Kikkamin I have tested ur code 3 times and it did pass
Joseph
@revisualize
Nov 04 2016 01:53
var myStr = '<a href="http://www.example.com" target="_blank">Link</a>';
That passes.
Kikkamin
@Kikkamin
Nov 04 2016 01:53
@walidashri I understand. But what is wrong with my FreecodeCamp then? It won't pass.
Joseph
@revisualize
Nov 04 2016 01:53
This message was deleted
Sasha
@SashaKoro
Nov 04 2016 01:54
@RyWilliams I don't understand, I cannot set the value, it a global value based on what the user puts in
Walid Ashri
@walidashri
Nov 04 2016 01:54
@Kikkamin can u give a screenshot
Luke
@Yawodo
Nov 04 2016 01:55
Could anybody possibly help me with this challenge: https://www.freecodecamp.com/challenges/convert-celsius-to-fahrenheit
Joseph
@revisualize
Nov 04 2016 01:55
@Kikkamin That works for me.. Screenshot incoming.
Kikkamin
@Kikkamin
Nov 04 2016 01:55
@walidashri Tell me how to give you my screen shot?
Walid Ashri
@walidashri
Nov 04 2016 01:56
@Kikkamin printscreen then paste
Joseph
@revisualize
Nov 04 2016 01:56
blob
@Kikkamin ---^^^
Kikkamin
@Kikkamin
Nov 04 2016 01:56
@revisualize I still got one error message. Here it is: Remove all the backslashes ()
Joseph
@revisualize
Nov 04 2016 01:56
Oh look.. Someone PM'd me.
Conor Murphy
@cmurphy580
Nov 04 2016 02:01
@RyWilliams sweet. thank you. i"ll check it out
CamperBot
@camperbot
Nov 04 2016 02:01
cmurphy580 sends brownie points to @rywilliams :sparkles: :thumbsup: :sparkles:
:cookie: 313 | @rywilliams |http://www.freecodecamp.com/rywilliams
ehutchllew
@ehutchllew
Nov 04 2016 02:01
@Yawodo You just need to look up what the conversion formula is
Emily Sperry
@sperrye
Nov 04 2016 02:01
OK... Why would my function return [native code]?
ehutchllew
@ehutchllew
Nov 04 2016 02:01
@Yawodo fahrenheit = (celsius * (9/5) + 32)
Luke
@Yawodo
Nov 04 2016 02:01
ok let me process that
Joseph
@revisualize
Nov 04 2016 02:01
@sperrye Can I see?
Emily Sperry
@sperrye
Nov 04 2016 02:02
function titleCase(str) {

  var splitUp = str.toLowerCase().split(' ');

  for (var i = 0; i < splitUp.length; i++) {
    splitUp[i] = splitUp[i].charAt(0).toUpperCase + splitUp[i].substring(1);
  }
  return splitUp.join(' ');

}

titleCase("I'm a little tea pot");
returns:
function titleCase(str) {

  var splitUp = str.toLowerCase().split(' ');

  for (var i = 0; i < splitUp.length; i++) {
    splitUp[i] = splitUp[i].charAt(0).toUpperCase + splitUp[i].substring(1);
  }
  return splitUp.join(' ');

}

titleCase("I'm a little tea pot");
uh, not that
ehutchllew
@ehutchllew
Nov 04 2016 02:03
@sperrye what was the waypoint name?
Emily Sperry
@sperrye
Nov 04 2016 02:04
I don't know what a waypoint is
Joseph
@revisualize
Nov 04 2016 02:04
@sperrye Wayports are what the basic challenges were called before the rename.
@ehutchllew This would be a Bonfire.
silver537
@silver537
Nov 04 2016 02:05
@sperrye he means the name of the challenge
Joseph
@revisualize
Nov 04 2016 02:05
@sperrye let's put that into pythontutor.
Walid Ashri
@walidashri
Nov 04 2016 02:05
@sperrye missing () here splitUp[i].charAt(0).toUpperCase +
Luke
@Yawodo
Nov 04 2016 02:05
@ehutchllew wow thanks i got it. That was quite easy, the formatting is what catches me out at the minute
CamperBot
@camperbot
Nov 04 2016 02:05
yawodo sends brownie points to @ehutchllew :sparkles: :thumbsup: :sparkles:
:cookie: 305 | @ehutchllew |http://www.freecodecamp.com/ehutchllew
Emily Sperry
@sperrye
Nov 04 2016 02:06
ah! There it is! thanks @walidashri @revisualize @ehutchllew
CamperBot
@camperbot
Nov 04 2016 02:06
sperrye sends brownie points to @walidashri and @revisualize and @ehutchllew :sparkles: :thumbsup: :sparkles:
:star2: 2218 | @revisualize |http://www.freecodecamp.com/revisualize
:cookie: 306 | @ehutchllew |http://www.freecodecamp.com/ehutchllew
:cookie: 567 | @walidashri |http://www.freecodecamp.com/walidashri
Joseph
@revisualize
Nov 04 2016 02:06
@sperrye you're not doing .toUpperCase()
jrandallhansen
@jrandallhansen
Nov 04 2016 02:06
@sjames1958gm are you around? i need help! haha
Emily Sperry
@sperrye
Nov 04 2016 02:06
I read it a thousand times and missed that one little () every time
ehutchllew
@ehutchllew
Nov 04 2016 02:06
@Yawodo PEMDAS :)
Emily Sperry
@sperrye
Nov 04 2016 02:07
Memorizing all the little pieces... I need to go make flashcards.
Luke
@Yawodo
Nov 04 2016 02:07
@ehutchllew had to google that but thanks ^^ i'll put it on a sticky note !
CamperBot
@camperbot
Nov 04 2016 02:07
yawodo sends brownie points to @ehutchllew :sparkles: :thumbsup: :sparkles:
:warning: yawodo already gave ehutchllew points
Luke
@Yawodo
Nov 04 2016 02:07
no more points for you sir :worried:
Sasha
@SashaKoro
Nov 04 2016 02:07
while (myVariable != 1) {
    myVariable = otherFunction(myVariable);
    }
Joseph
@revisualize
Nov 04 2016 02:07
@sperrye I used Flash Cards when I was trying to memories TCP / IP port numbers.
silver537
@silver537
Nov 04 2016 02:08
@sperrye no.. you just need to repeat yourself a lot. starting the algorithms from the beginning should do the trick
Sasha
@SashaKoro
Nov 04 2016 02:08
is there anything wrong with that code?
Kikkamin
@Kikkamin
Nov 04 2016 02:08
@ehutchllew My code is correct but still have error messages. Is there a bug?
Dany
@Danylrs
Nov 04 2016 02:08
Hello everyone! :smile:
Joseph
@revisualize
Nov 04 2016 02:08
You're not changing the value of myVariable?
Emily Sperry
@sperrye
Nov 04 2016 02:08
@silver537 sorry? I'm still at the beginning..?
Kikkamin
@Kikkamin
Nov 04 2016 02:08
@walidashri My code is correct but is there a bug?
ehutchllew
@ehutchllew
Nov 04 2016 02:08
@Yawodo dang, thanks for trying though! haha
CamperBot
@camperbot
Nov 04 2016 02:08
ehutchllew sends brownie points to @yawodo :sparkles: :thumbsup: :sparkles:
:cookie: 42 | @yawodo |http://www.freecodecamp.com/yawodo
ehutchllew
@ehutchllew
Nov 04 2016 02:08
@Kikkamin sorry, can you paste it again?
Dany
@Danylrs
Nov 04 2016 02:08
Im having an issue understanding this lesson: Increment a Number with JavaScript
silver537
@silver537
Nov 04 2016 02:09
@sperrye oh. well finish that section, then redo it.
ehutchllew
@ehutchllew
Nov 04 2016 02:09
@Danylrs paste code, and let me know what your questions are
Joseph
@revisualize
Nov 04 2016 02:09
OMG! I just got a call that I may be in a sailboat race around San Juan County. :D :exclamation:
:sailboat: :sailboat: :sailboat: :sailboat: :sailboat: :sailboat: :sailboat: :sailboat: :sailboat: :sailboat: :sailboat: :sailboat: :sailboat: :sailboat: :sailboat: :sailboat: :sailboat: :sailboat: :sailboat: :sailboat: :sailboat: :sailboat: :sailboat: :sailboat:
Kikkamin
@Kikkamin
Nov 04 2016 02:09
@ehutchllew Here is what I try to do: LESSON: Quoting Strings with Single Quotes AND I constantly got the two eror messages: Remove all the backslashes ()
You should have two single quotes ' and four double quotes " and here is my code: var myStr = '<a href="http://www.example.com" target="_blank">Link</a>';I have reset my page and refreshed many, many times. Can you help me?
Joseph
@revisualize
Nov 04 2016 02:09
@Kikkamin We need a screenshot.
Nelson
@nelruk
Nov 04 2016 02:10
Thank you @bulanov416 fot the help...
CamperBot
@camperbot
Nov 04 2016 02:10
nelruk sends brownie points to @bulanov416 :sparkles: :thumbsup: :sparkles:
:cookie: 216 | @bulanov416 |http://www.freecodecamp.com/bulanov416
Joseph
@revisualize
Nov 04 2016 02:10
var myStr = '<a href="http://www.example.com" target="_blank">Link</a>';
ehutchllew
@ehutchllew
Nov 04 2016 02:10
@Kikkamin not sure which lesson it is... try using the "```" coding format
Kikkamin
@Kikkamin
Nov 04 2016 02:10
@revisualize help me with the screenshot. I don't know how to do it.
Alex Bulanov
@bulanov416
Nov 04 2016 02:10
any time friend @nelruk
Joseph
@revisualize
Nov 04 2016 02:10
@Kikkamin That worked for me. If you're not doing that.. Then you have a problem.
Dany
@Danylrs
Nov 04 2016 02:10
@ehutchllew

var myVar = 87;

// Only change code below this line
myVar = myVar++ + 1;
Nelson
@nelruk
Nov 04 2016 02:10
again, thanks for real @bulanov416
CamperBot
@camperbot
Nov 04 2016 02:10
nelruk sends brownie points to @bulanov416 :sparkles: :thumbsup: :sparkles:
:warning: nelruk already gave bulanov416 points
Joseph
@revisualize
Nov 04 2016 02:10
@Danylrs You don't need an =
@Danylrs Example:
var num = 5;
num = num + 1; // 6
num += 1; // 7
num++; // 8
Nelson
@nelruk
Nov 04 2016 02:11
@camperbot I DON'T CARE IF I SAID I WANNA SAY IT TWICE..
ehutchllew
@ehutchllew
Nov 04 2016 02:11

@Danylrs okay so:

myVar++;

is the same as:

myVar = myVar + 1;
Sasha
@SashaKoro
Nov 04 2016 02:11
myVariable = otherFunction(myVariable);
Kikkamin
@Kikkamin
Nov 04 2016 02:11
@revisualize I know it worked for other people but I am stuck with these error messages.
Alex Bulanov
@bulanov416
Nov 04 2016 02:11
@nelruk hahaha
ehutchllew
@ehutchllew
Nov 04 2016 02:11
@Kikkamin try using a different browser
Alex Bulanov
@bulanov416
Nov 04 2016 02:11
@nelruk message me if you need help on anything else
Nelson
@nelruk
Nov 04 2016 02:11
I'm yelling to a bot, I'm tired..should go to sleep..
Joseph
@revisualize
Nov 04 2016 02:11
@Kikkamin I don't know.. Do you have other code in the editor?
Nelson
@nelruk
Nov 04 2016 02:12
@bulanov416 ok, i will..
Kikkamin
@Kikkamin
Nov 04 2016 02:12
@ehutchllew I am using Chrome. Is that an issue?
Dany
@Danylrs
Nov 04 2016 02:12
@ehutchllew @revisualize brb let me try this again thanks guys for the helpful hints
CamperBot
@camperbot
Nov 04 2016 02:12
danylrs sends brownie points to @ehutchllew and @revisualize :sparkles: :thumbsup: :sparkles:
:cookie: 307 | @ehutchllew |http://www.freecodecamp.com/ehutchllew
:star2: 2219 | @revisualize |http://www.freecodecamp.com/revisualize
Joseph
@revisualize
Nov 04 2016 02:12
@Kikkamin You should only have ONE line.
var myStr = '<a href="http://www.example.com" target="_blank">Link</a>';
ehutchllew
@ehutchllew
Nov 04 2016 02:12
@Danylrs using the myVar++; method doesn't require you to assign it.
Kikkamin
@Kikkamin
Nov 04 2016 02:12
@ehutchllew I will try Firefox now.
Joseph
@revisualize
Nov 04 2016 02:12
@Kikkamin I'm using Chrome on Ubuntu 16.04
jrandallhansen
@jrandallhansen
Nov 04 2016 02:13
anyone up for helping me debug my "Exact Change" algorithm. I think I have found the problem using console.log() statements instead of return statements in codepen. however I still dont know the cause of the problem
Kikkamin
@Kikkamin
Nov 04 2016 02:13
@revisualize THANK YOU! Thank you! Thank you!
CamperBot
@camperbot
Nov 04 2016 02:13
kikkamin sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 2220 | @revisualize |http://www.freecodecamp.com/revisualize
Joseph
@revisualize
Nov 04 2016 02:13
@Kikkamin What was the problem?
Nelson
@nelruk
Nov 04 2016 02:13
@Kikkamin was the problem the browser?
Luke
@Yawodo
Nov 04 2016 02:14
@ehutchllew Could I ask you something, it's a noob question but i'm only on day 2. On javascript other than var (variables) is there a list of the other generic functions that I can find somewhere
Kikkamin
@Kikkamin
Nov 04 2016 02:14
@nelruk I got it sorted.
Walid Ashri
@walidashri
Nov 04 2016 02:14
I think it was two lines :)
ehutchllew
@ehutchllew
Nov 04 2016 02:14
@Yawodo google everything. i use w3schools often. They'll have categories for that sort of stuff
Joseph
@revisualize
Nov 04 2016 02:14
Yeah.
jrandallhansen
@jrandallhansen
Nov 04 2016 02:15
@Yawodo variables are not functions. they are data types http://www.w3schools.com/js/js_datatypes.asp
Joseph
@revisualize
Nov 04 2016 02:15
W3Schools sucks.... www.devdocs.io
ehutchllew
@ehutchllew
Nov 04 2016 02:15
meh, i like it
Emily Sperry
@sperrye
Nov 04 2016 02:15
w3schools could improve their try-it editor, but otherwise I like it
jrandallhansen
@jrandallhansen
Nov 04 2016 02:15
@Yawodo either one will suffice for this topic. google "javascript datatypes"
Joseph
@revisualize
Nov 04 2016 02:15
hashtag-lame
Emily Sperry
@sperrye
Nov 04 2016 02:15
for reference more than lessons
ehutchllew
@ehutchllew
Nov 04 2016 02:15
yep
if i just want an example of how to do something and a quick description, w3 is amazing
Joseph
@revisualize
Nov 04 2016 02:16
I used to be a w3schools fan.. Then I found devdocs.io
Luke
@Yawodo
Nov 04 2016 02:16
thank you
ehutchllew
@ehutchllew
Nov 04 2016 02:16
i'll check it out
Luke
@Yawodo
Nov 04 2016 02:16
!
Joseph
@revisualize
Nov 04 2016 02:16
CRAP! I'm going to lose my streak!!!
:cry:
Nelson
@nelruk
Nov 04 2016 02:16
W3Schools sucks.... www.devdocs.io
Since a friend told me about DevDocs, I'm using it as my primary source of JS
ehutchllew
@ehutchllew
Nov 04 2016 02:17
definitely like it more than mozilla developer
Nelson
@nelruk
Nov 04 2016 02:17
Hey, if anyone is looking for a Code Editor nice and clean and free and with more stuffs..check www.atom.io
jrandallhansen
@jrandallhansen
Nov 04 2016 02:17
i like Mozilla Developer
Joseph
@revisualize
Nov 04 2016 02:17
MDN is good for JS.
ehutchllew
@ehutchllew
Nov 04 2016 02:17
i don't like it's textbook format
jrandallhansen
@jrandallhansen
Nov 04 2016 02:18
hey, if anyone is looking for a brain-tickling teaser, check https://codepen.io/jrandall/pen/yabKad?editors=0011 and try to figure out why the code is returning two console.log() statements instead of just one as it should
silver537
@silver537
Nov 04 2016 02:18
@revisualize daaaaamn never knew devdocs.io existed
Howl
@karst10607
Nov 04 2016 02:18
wow, looks nice!
Joseph
@revisualize
Nov 04 2016 02:18
DAMN IT!
ehutchllew
@ehutchllew
Nov 04 2016 02:18
i have been watching some awesome videos on youtube, this one guy has a really great way of conveying everything web development
Joseph
@revisualize
Nov 04 2016 02:18
@silver537 I blame YOU!
@ehutchllew Who?
jrandallhansen
@jrandallhansen
Nov 04 2016 02:19
@ehutchllew Who?
silver537
@silver537
Nov 04 2016 02:19
@revisualize lol wot?
ehutchllew
@ehutchllew
Nov 04 2016 02:19
account is learncode.academy
check out his playlists
Joseph
@revisualize
Nov 04 2016 02:19
@ehutchllew Yeah. He's good.
ehutchllew
@ehutchllew
Nov 04 2016 02:19
i basically just watched his Jquery playlist, and was able to do the weather app without much other help
Joseph
@revisualize
Nov 04 2016 02:19
@silver537 I blame YOU! I'm not going sailboat racing this weekend and I'm going to say it is all your fault.
Luke
@Yawodo
Nov 04 2016 02:19
@jrandallhansen @revisualize great help (y)
silver537
@silver537
Nov 04 2016 02:19
lol good! i didn't want you to go anyways
Joseph
@revisualize
Nov 04 2016 02:20
@Yawodo I do it for the brownies.
Luke
@Yawodo
Nov 04 2016 02:20
@revisualize thanks
CamperBot
@camperbot
Nov 04 2016 02:20
yawodo sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 2221 | @revisualize |http://www.freecodecamp.com/revisualize
Joseph
@revisualize
Nov 04 2016 02:20
@silver537 It was going to be a sailboat race around San Juan County here in Washington State.
Luke
@Yawodo
Nov 04 2016 02:20
@revisualize :D
Joseph
@revisualize
Nov 04 2016 02:20
:D
@Yawodo Thanks. I just need 1 more.
CamperBot
@camperbot
Nov 04 2016 02:20
revisualize sends brownie points to @yawodo :sparkles: :thumbsup: :sparkles:
:cookie: 44 | @yawodo |http://www.freecodecamp.com/yawodo
Emily Sperry
@sperrye
Nov 04 2016 02:20
In November?!
Luke
@Yawodo
Nov 04 2016 02:20
what can you do with brownies?
Emily Sperry
@sperrye
Nov 04 2016 02:20
That's asking to go for a very cold swim.
Joseph
@revisualize
Nov 04 2016 02:20
@sperrye Yes.
@Yawodo Nothing.
silver537
@silver537
Nov 04 2016 02:21
@revisualize never been there. i hope you win!
Luke
@Yawodo
Nov 04 2016 02:21
just get fat huh
Joseph
@revisualize
Nov 04 2016 02:21
@sperrye Good because I don't know how to swim.
jrandallhansen
@jrandallhansen
Nov 04 2016 02:21
ive been stuck on this algorithm for two days now. it is ruining my life
Joseph
@revisualize
Nov 04 2016 02:21
@silver537 I'm not going.
ehutchllew
@ehutchllew
Nov 04 2016 02:21
@revisualize one more? Well thanks for the devdocs!
CamperBot
@camperbot
Nov 04 2016 02:21
ehutchllew sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 2222 | @revisualize |http://www.freecodecamp.com/revisualize
Joseph
@revisualize
Nov 04 2016 02:21
@silver537 The boat Captain said no.
@ehutchllew Well, that's a bit cheating.
silver537
@silver537
Nov 04 2016 02:21
@revisualize fuuuuuuck. and it's allll my fault!
ehutchllew
@ehutchllew
Nov 04 2016 02:22
:|
Joseph
@revisualize
Nov 04 2016 02:22
@silver537 I know right.
ehutchllew
@ehutchllew
Nov 04 2016 02:22
legitimate good source!
Emily Sperry
@sperrye
Nov 04 2016 02:22
@jrandallhansen I probably can't help you, but the suspense is killing me. Which one are you stuck on?
Joseph
@revisualize
Nov 04 2016 02:22
@silver537 :P
jrandallhansen
@jrandallhansen
Nov 04 2016 02:22
Exact Change
Joseph
@revisualize
Nov 04 2016 02:22
@jrandallhansen Sorry. I'm not that far.
jrandallhansen
@jrandallhansen
Nov 04 2016 02:22
it is like a cash register app.
@revisualize no worries. you'll probably breeze right through when you get here! lol
Joseph
@revisualize
Nov 04 2016 02:23
@sperrye It's one of the Advanced Algos.
Emily Sperry
@sperrye
Nov 04 2016 02:23
Sounds gross!
Joseph
@revisualize
Nov 04 2016 02:23
@ehutchllew It's all good. I'm still going to post the screenshot to tweeter.
jrandallhansen
@jrandallhansen
Nov 04 2016 02:24
i wish @sjames1958gm the guru was here to help me
ehutchllew
@ehutchllew
Nov 04 2016 02:24
the guruuu
jrandallhansen
@jrandallhansen
Nov 04 2016 02:24
ugh it is like ruining my progress lol
silver537
@silver537
Nov 04 2016 02:25
@jrandallhansen you don't have to do them.
Joseph
@revisualize
Nov 04 2016 02:25
@sperrye I've raced Round the County twice now. I've even raced from Seattle around Smith Island. Smith Island race was 22hours straight. I was sleeping on the rail of the sailboat in the middle of the rain with sea water splashing up at me. While the night conditions were crappy it was a really fun race.
jrandallhansen
@jrandallhansen
Nov 04 2016 02:25
@silver537 if i want to learn the concepts and material i cant skip them!
ehutchllew
@ehutchllew
Nov 04 2016 02:25
does anyone know why I can't use Night Mode? Says "Authorization Required" :|
jrandallhansen
@jrandallhansen
Nov 04 2016 02:25
I dont even know what night mode is
silver537
@silver537
Nov 04 2016 02:25
@jrandallhansen those advanced algos don't teach you anything you already know.
jrandallhansen
@jrandallhansen
Nov 04 2016 02:26
@silver537 then why cant i figure out what i am doing wrong here?? i do understand what you are saying though. the advanced algos are just kinda longer versions of the earlier ones
but i think they may help me learn to stay organized in slightly longer and longer projects
silver537
@silver537
Nov 04 2016 02:27
you don't understand because you havn't conditioned your brain to think logically. which is normal
Joseph
@revisualize
Nov 04 2016 02:28
@silver537 @jrandallhansen You need to learn how to ...
https://www.youtube.com/playlist?list=PLKQ5LYb497AZIZe9dBWy8GwLluVaMQVj0
jrandallhansen
@jrandallhansen
Nov 04 2016 02:28
@silver537 did you want to take a look and see if you could identify the mistake or just make blanket judgments with zero idea of their validity? I can't say you are being particularly helpful
silver537
@silver537
Nov 04 2016 02:28
you can check my solution if you want
jrandallhansen
@jrandallhansen
Nov 04 2016 02:28
or did you already look at my code and find a logical fallacy?
Emily Sperry
@sperrye
Nov 04 2016 02:28
@revisualize I like land.
jrandallhansen
@jrandallhansen
Nov 04 2016 02:29
@silver537 skipping algorithms or copying answers isn't my plan of action but thank you I suppose.
CamperBot
@camperbot
Nov 04 2016 02:29
jrandallhansen sends brownie points to @silver537 :sparkles: :thumbsup: :sparkles:
:cookie: 672 | @silver537 |http://www.freecodecamp.com/silver537
Emily Sperry
@sperrye
Nov 04 2016 02:29
Mostly because I'm super freaked out about being touched by a fish if I'm in water.
They are disgusting.
Joseph
@revisualize
Nov 04 2016 02:31
@sperrye Well, I've sailboat raced for 3.5 years (I haven't raced that much in the last year.) and I don't know how to swim. So.... Yeah.
ehutchllew
@ehutchllew
Nov 04 2016 02:31
@jrandallhansen what is it you're having issues with >?
Emily Sperry
@sperrye
Nov 04 2016 02:31
@revisualize well fish can jump.
Joseph
@revisualize
Nov 04 2016 02:32
True.
silver537
@silver537
Nov 04 2016 02:32
@sperrye have you touched fish before?
Emily Sperry
@sperrye
Nov 04 2016 02:32
flop around in the boat staring at you with that nasty gelatinous eyeball
Joseph
@revisualize
Nov 04 2016 02:32
The only thing that I have seen jump are porpoises and orca
Emily Sperry
@sperrye
Nov 04 2016 02:33
@silver537 Yeah, it's basically required if you want to live in WA
Joseph
@revisualize
Nov 04 2016 02:33
I did see a blue whale arch out of the water. That was cool it was like 150 yards from us.
Emily Sperry
@sperrye
Nov 04 2016 02:33
They kick you out if you don't
Joseph
@revisualize
Nov 04 2016 02:33
@sperrye What part of WA?
Emily Sperry
@sperrye
Nov 04 2016 02:33
East side
Joseph
@revisualize
Nov 04 2016 02:33
I'm in Seattle. .. If you haven't guessed.
Emily Sperry
@sperrye
Nov 04 2016 02:33
I know, because you're in the facebook group
Joseph
@revisualize
Nov 04 2016 02:34
Ahh.
SPEAKING OF!
jrandallhansen
@jrandallhansen
Nov 04 2016 02:34
@ehutchllew if you run the algorithm in the standard case (enough cash in drawer to provide change) it still runs console.log("Insufficient Funds"); before it logs the changeDue array. it should only log the changeDue array not both. when i change the statements to return statements it will return "Insufficient Funds" and exit the function i believe before it gets to my changeDue array
Joseph
@revisualize
Nov 04 2016 02:34
@sperrye Thanks for reminding me.
CamperBot
@camperbot
Nov 04 2016 02:34
revisualize sends brownie points to @sperrye :sparkles: :thumbsup: :sparkles:
:cookie: 258 | @sperrye |http://www.freecodecamp.com/sperrye
Emily Sperry
@sperrye
Nov 04 2016 02:35
:camel:
there's a camel.
Thomas Gerot
@tjgerot
Nov 04 2016 02:35
@sperrye Happy Hump Day
Emily Sperry
@sperrye
Nov 04 2016 02:36
I'm definitely procrastinating
silver537
@silver537
Nov 04 2016 02:36
yes you are ^
get back to coding!
Joseph
@revisualize
Nov 04 2016 02:39
@sperrye There we go.. Posted.
jrandallhansen
@jrandallhansen
Nov 04 2016 02:40
nevermind everyone i found the error. thanks!
Emily Sperry
@sperrye
Nov 04 2016 02:40
:balloon: for @jrandallhansen
jrandallhansen
@jrandallhansen
Nov 04 2016 02:41
thanks! @sperrye word of advice as you move forward, dont try to check if an array is equal to a number (i forgot to call the method i wrote to get the cash total from the array and just called the array instead lol)
CamperBot
@camperbot
Nov 04 2016 02:41
jrandallhansen sends brownie points to @sperrye :sparkles: :thumbsup: :sparkles:
:cookie: 259 | @sperrye |http://www.freecodecamp.com/sperrye
Emily Sperry
@sperrye
Nov 04 2016 02:42
noted
Joseph
@revisualize
Nov 04 2016 02:50
Let's see if anyone takes me up on my Coffee and Code thingie.
silver537
@silver537
Nov 04 2016 02:52
man i would love to have a fellow coder to code with
Emily Sperry
@sperrye
Nov 04 2016 02:56
@silver537 trail anime and candy into a deep well
silver537
@silver537
Nov 04 2016 02:56
.....wat? 0.o
Emily Sperry
@sperrye
Nov 04 2016 02:57
Buffalo Bill style
silver537
@silver537
Nov 04 2016 02:57
you better be coding.
Joseph
@revisualize
Nov 04 2016 02:57
@silver537 Well, it may not always be a good thing. Especially from me.. Some people think that I just float around and swing my dick around.
silver537
@silver537
Nov 04 2016 02:58
where did that come from?
Emily Sperry
@sperrye
Nov 04 2016 02:58
I'm totally coding.
@revisualize you were being a crap muffin that day
Joseph
@revisualize
Nov 04 2016 02:58
WTF is a crap muffin?
Emily Sperry
@sperrye
Nov 04 2016 02:59
I
do not know
Joseph
@revisualize
Nov 04 2016 02:59
@silver537 Apparently that day I was a crap muffin.
silver537
@silver537
Nov 04 2016 03:01
@silver537 trail anime and candy into a deep well
wtf was that ^
Emily Sperry
@sperrye
Nov 04 2016 03:03
How to trap a coder so you have one to code with.
You might get a weeaboo though.
Joseph
@revisualize
Nov 04 2016 03:03
@sperrye What?
silver537
@silver537
Nov 04 2016 03:03
but i don't anime nor am i a candy eater :expressionless:
Emily Sperry
@sperrye
Nov 04 2016 03:05
Fine, hot dogs and Time Magazines
Joseph
@revisualize
Nov 04 2016 03:05
@sperrye I think you're asking about pair programming.
@sperrye I use https://codeshare.io/ for pair programming.
silver537
@silver537
Nov 04 2016 03:06
@sperrye now you're talking :D
Emily Sperry
@sperrye
Nov 04 2016 03:06
@revisualize That looks really cool.
Joseph
@revisualize
Nov 04 2016 03:07
@sperrye I've helped a bunch of people with that sight.
@sperrye I'm almost willing to pair with anyone that wants / needs it.
Emily Sperry
@sperrye
Nov 04 2016 03:09
twss
I gotta go read some Berenstain Bears, BBL
silver537
@silver537
Nov 04 2016 03:09
wow..
weirdo
:P
do something
hmm not bad @revisualize
Joseph
@revisualize
Nov 04 2016 03:14
Yeah, the video stuff is pretty cool too. Because you can just talk back and forth.
11step
@11step
Nov 04 2016 03:14
Check for Palindromes Incomplete?who konw this,I have a difficult
Joseph
@revisualize
Nov 04 2016 03:15
I had one person that didn't want to be on video. So, I just had them cover up their webcam.
@11step What is your code?
silver537
@silver537
Nov 04 2016 03:15
yea i have a tape covering my cam all the time. paranoia man
11step
@11step
Nov 04 2016 03:15

function palindrome(str) {
// Good luck!

var str1=str.replace(/\w\s/g);

var str2=str1.tolowerCase();

if(str2===str2.reserve()){
return true;

}else{

return false;
}

}

palindrome("eye");

Saneer Gera
@saneergera
Nov 04 2016 03:15

I am solving seek and destroy and I am not able to figure out my mistake please help

function destroyer(arr) {
// Remove all the values
var x = arr[1];
var y = arr[2];
function refine(arg)
{

return arg!==x||arg!==y;

}
var a = arr[0].filter(refine);

return a;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);

ERROR -: arr[0].filter is not a function

Joseph
@revisualize
Nov 04 2016 03:18
This message was deleted
Thomas Gerot
@tjgerot
Nov 04 2016 03:18
@saneergera As you can see here the filter() function only works on arrays.
Joseph
@revisualize
Nov 04 2016 03:18
@11step You're not doing your .replace() correctly. You're trying to .reverse() a string and that is an array method.
Thomas Gerot
@tjgerot
Nov 04 2016 03:19
@11step Take a look at the .split() method.
Joseph
@revisualize
Nov 04 2016 03:19
[true, true, false, false, true, false, false, true, true].filter(function (x) { return x });
[23,1,6,12,17,3,2,5,19,86,87].filter(function (x) {return x % 2 });
11step
@11step
Nov 04 2016 03:20
@tjgerot OK thank you, I have a try
CamperBot
@camperbot
Nov 04 2016 03:20
11step sends brownie points to @tjgerot :sparkles: :thumbsup: :sparkles:
:cookie: 113 | @tjgerot |http://www.freecodecamp.com/tjgerot
Joseph
@revisualize
Nov 04 2016 03:21
Oh! I'm chop liver over here.
LOL!
silver537
@silver537
Nov 04 2016 03:21
what?
Owa Aquino
@owaaquino
Nov 04 2016 03:26
hello
anybody there? I have some javascript question :)
silver537
@silver537
Nov 04 2016 03:27
no one will help you without your code
guess he didn't need help after all
Ogundele Olumide
@Lumexralph
Nov 04 2016 03:29
@owaaquino what question?
Saneer Gera
@saneergera
Nov 04 2016 03:30
@tjgerot i have applied filter function on arr[0] which is an array .Still why is it not working?
Owa Aquino
@owaaquino
Nov 04 2016 03:34
sorry to take so long haha
well may problem is the "Cancel" button in the "Edit Mode
*my
i can't make it work
its just return undefined
Thomas Gerot
@tjgerot
Nov 04 2016 03:36
@saneergera When you defined the destroyer function, you told the program to expect 1 parameter called arr. Then when you called the destroyer function here destroyer([1, 2, 3, 1, 2, 3], 2, 3); you gave it three arguments. You called the function with 3 arguments, not an array of 3 values (array, number, number). Therefore, your program assumed arr was the first argument it got ([1, 2, 3, 1, 2, 3]) and when you called arr[0] it looked to the zeroth element in arr which is 1 (a number not an array).
Saneer Gera
@saneergera
Nov 04 2016 03:37
@tjgerot thank u sir .now i get my mistake
CamperBot
@camperbot
Nov 04 2016 03:37
saneergera sends brownie points to @tjgerot :sparkles: :thumbsup: :sparkles:
:cookie: 114 | @tjgerot |http://www.freecodecamp.com/tjgerot
Fealios
@Fealios
Nov 04 2016 03:40
Hey guys, having a difficult time with my DNA pairing algorithm challenge, could anyone lend a hand?
var firstString = ("ATCG")
var firstPair = firstString.split('');
var secondString = ("TAGC");
var secondPair = secondString.split('');

var emptyArr = [];

function pairElement(str){
    var input= str.split('');
    for (i=0;i<str.length;i++){
        for (j=0;i<str.length;j++)
        if (str[i]===secondPair[j]){
            emptyArr.push(str[i]+secondPair[j])
        } else {
        console.log("there is no match");
    }
    } 

}; //the end

pairElement("CCTC");

pairElement("CCTC");
Thomas Gerot
@tjgerot
Nov 04 2016 03:40
@owaaquino I'll take a look.
silver537
@silver537
Nov 04 2016 03:41
there's nothing in your if statement
Mitch
@MitchWilkins
Nov 04 2016 03:41

In short this doesn't give me the letters, just "\u0000" I feel like I'm missing a step between the conversion
```function rot13(str) { // LBH QVQ VG!
var letters = "";
var convert = "";
function numberConvert(number) {
var abs = 0;
if (number === 32 ) {
return 32;

} else if (number > 77) {
  return number - 90 + 65;
} else {
  return number;
}

}
var newArray = [];
var split = str.split('');
var ccode = "";
for (var i = 0; i < split.length; i++) {
ccode = split[i].charCodeAt(0);
newArray.push(ccode);
}
for (var j = 0; j < split.length; j++) {
newArray.unshift(String.fromCharCode(split[j]));
newArray.pop(ccode);

}
return newArray;
}
```

Dany
@Danylrs
Nov 04 2016 03:42
hey campers, how can we tell how many hours we have been working on projects thus far
Fealios
@Fealios
Nov 04 2016 03:42
@silver537 woops, updated it
i must have posted a different version
silver537
@silver537
Nov 04 2016 03:42
there's no return either
Thomas Gerot
@tjgerot
Nov 04 2016 03:43
@owaaquino is the cancelBtn() function the one returning undefined
Fealios
@Fealios
Nov 04 2016 03:44
@silver537 i tested it with the return, and it doesnt owkr
uxdash
@uxdash
Nov 04 2016 03:55
Hey guys I am having a bit of trouble with the counting cards assignment. Can anyone please help?
countingcards.png
Walid Ashri
@walidashri
Nov 04 2016 03:58
@uxdash first u don't need break after return 2nd u need to return count not the card
Daniel Miguel Molina Obana
@dannymolina2
Nov 04 2016 04:04
hi guys!
someone can help me to fix my code
Ogundele Olumide
@Lumexralph
Nov 04 2016 04:05
@dannymolina2
Let's see your code
Ken Haduch
@khaduch
Nov 04 2016 04:05
@Danylrs - I don't think there is a way to tell how many hours you've spent.
Daniel Miguel Molina Obana
@dannymolina2
Nov 04 2016 04:06
```
$(window).load(function() {
var date = new Date(),
d = date.getDate(),
m = date.getMonth(),
y = date.getFullYear(),
started,
categoryClass;
    var calendar = $('#calendar').fullCalendar({
      header: {
        left: 'prev,next today',
        center: 'title',
        right: 'month,agendaWeek,agendaDay'
      },
      selectable: true,
      selectHelper: true,
      select: function(start, end, allDay) {
        $('#fc_create').click();

        started = start;
        ended = end;

        $(".antosubmit").on("click", function() {
          var title = $("#title").val();
          if (end) {
            ended = end;
          }

          categoryClass = $("#event_type").val();

          if (title) {
            calendar.fullCalendar('renderEvent', {
                title: title,
                start: started,
                end: end,
                allDay: allDay
              },
              true // make the event "stick"
            );
          }

          $('#title').val('');

          calendar.fullCalendar('unselect');

          $('.antoclose').click();

          return false;
        });
      },
      eventClick: function(calEvent, jsEvent, view) {
        $('#fc_edit').click();
        $('#title2').val(calEvent.title);

        categoryClass = $("#event_type").val();

        $(".antosubmit2").on("click", function() {
          calEvent.title = $("#title2").val();

          calendar.fullCalendar('updateEvent', calEvent);
          $('.antoclose2').click();
        });

        calendar.fullCalendar('unselect');
      },
      editable: true,
      events: [{
        title: 'All Day Event',
        start: new Date(y, m, 1)
      }, {
        title: 'Long Event',
        start: new Date(y, m, d - 5),
        end: new Date(y, m, d - 2)
      }, {
        title: 'Meeting',
        start: new Date(y, m, d, 10, 30),
        allDay: false
      }, {
        title: 'Lunch',
        start: new Date(y, m, d + 14, 12, 0),
        end: new Date(y, m, d, 14, 0),
        allDay: false
      }, {
        title: 'Birthday Party',
        start: new Date(y, m, d + 1, 19, 0),
        end: new Date(y, m, d + 1, 22, 30),
        allDay: false
      }, {
        title: 'Click for Google',
        start: new Date(y, m, 28),
        end: new Date(y, m, 29),
        url: 'http://google.com/'
      }]
    });
  });
i want to know how to save the new event
Deepak
@delta12kilo
Nov 04 2016 04:06
hey guys i'm having trouble in "convert celsius to fahrenheit" challenge .....
Daniel Miguel Molina Obana
@dannymolina2
Nov 04 2016 04:07
because every time I update the page are removed
Joseph
@revisualize
Nov 04 2016 04:11
@dannymolina2 Come on. Really?
Get help on our basic JavaScript and Algorithms Challenges. If you are posting code that is large use Gist - https://gist.github.com/ paste the link here.
That is in the Title of the chatroom.
Jonathan Maddison
@jonathanwmaddison
Nov 04 2016 04:16
Hi all, can anyone help me out? I'm trying to write a function for a codewars problem and google searches have not been helpful. the function add should behave: function add(2)(2) // 4 (adding both numbers) - I haven't seen anything like this before.
Johnny
@JohnnyBizzel
Nov 04 2016 04:16
@delta12kilo did you understand what you have to do?
Jonathan Maddison
@jonathanwmaddison
Nov 04 2016 04:16
Any tips about what I should search for online would be helpful
Thanks
Deepak
@delta12kilo
Nov 04 2016 04:18
no @JohnnyBizzel ... i'm stuck on this challenge.
Johnny
@JohnnyBizzel
Nov 04 2016 04:21
@delta12kilo If you had a calculator, how would you do it? https://www.mathsisfun.com/temperature-conversion.html
Ogundele Olumide
@Lumexralph
Nov 04 2016 04:21
@jonathanwmaddison that's use closure
Jonathan Maddison
@jonathanwmaddison
Nov 04 2016 04:24
@Lumexralph Thanks for the tip!
CamperBot
@camperbot
Nov 04 2016 04:24
jonathanwmaddison sends brownie points to @lumexralph :sparkles: :thumbsup: :sparkles:
:cookie: 404 | @lumexralph |http://www.freecodecamp.com/lumexralph
Ogundele Olumide
@Lumexralph
Nov 04 2016 04:24
@jonathanwmaddison search for closure examples that should help, it's a function returning another function but that function having a way of remembering the scope of the function that called it or return it, something like function (a) { return function(b) { return a + b} }
uxdash
@uxdash
Nov 04 2016 04:26
Ok... I'm getting closer on this counting cards exercise. 1 hour deep lol. Can anyone help?
Ogundele Olumide
@Lumexralph
Nov 04 2016 04:26
@jonathanwmaddison when you call the function (a) (b)..... It should output the result of the addition of a +b, using mobile app so can't type code properly, hope that helps
uxdash
@uxdash
Nov 04 2016 04:26
countingcards.png
Can I even complete this with a switch statement?
Ogundele Olumide
@Lumexralph
Nov 04 2016 04:27
@uxdash yes you can use switch
Deepak
@delta12kilo
Nov 04 2016 04:29
@JohnnyBizzel it's done ...thanks
uxdash
@uxdash
Nov 04 2016 04:29
What am I doing wrong?
I've hit a wall
Joseph
@revisualize
Nov 04 2016 04:30
@uxdash Let's show you.
@uxdash You're writing a REALLY long switch.
You don't need to.
@uxdash You can actually combine a bunch of statements together.
function cc(card) {
  // Only change code below this line
  switch(card){
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
      count++;
      break;
uxdash
@uxdash
Nov 04 2016 04:32
OMG
Lolz
Joseph
@revisualize
Nov 04 2016 04:33
@uxdash Also... You shouldn't be returning count within your switch.
You should evaluate count and based upon that number return select text.
uxdash
@uxdash
Nov 04 2016 04:34
Thank you @revisualize
CamperBot
@camperbot
Nov 04 2016 04:34
uxdash sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 2223 | @revisualize |http://www.freecodecamp.com/revisualize
uxdash
@uxdash
Nov 04 2016 04:34
I put the return statements outside the switch
Just changed it to evaluate the count later on
Joseph
@revisualize
Nov 04 2016 04:34
@uxdash Yes. But, you need an if.
uxdash
@uxdash
Nov 04 2016 04:35
Depending on if it's greater than 0
Or <= 0
Joseph
@revisualize
Nov 04 2016 04:35
Yup.
uxdash
@uxdash
Nov 04 2016 04:35
It worked!!!!
Lol that was unnecssarily difficult
Joseph
@revisualize
Nov 04 2016 04:35
Make sense?
uxdash
@uxdash
Nov 04 2016 04:35
Once in a while I have a brain fart haha
Yea definitely, thanks
The switch shorthand syntax though... That's so perfect
perseusMyk
@perseusMyk
Nov 04 2016 04:40
 var result;

function findLongestWord(str) {

  comp = function (arr){
    for(var i = 0 ; i <arr.length ; i++){
       if(arr[i].length < arr[i+1].length){
            return  arr[i+1].length;
           }
       }
   };
  var array  = str.split(" ");
  comp(array);
};

findLongestWord("The quick brown fox jumyrrrrryyped over the lazy dog");
I m trying to compair the length of the element (string ) of an array . ..I get just returned of 5 . // consoled log it ;; it s quick ! like my for stop too soon;
maybe I m sleepy , but dont see what s wrong with this
Jonathan Maddison
@jonathanwmaddison
Nov 04 2016 04:45
@perseusMyk The reason it stops at 5 is because it is comparing "the" to "quick" and finding that quick is longer then return the length of quick. Try using a variable to capture the arr[i] value (and not the length) in your if statement
perseusMyk
@perseusMyk
Nov 04 2016 04:46
@jonathanwmaddison ok , I will try it .
c0d0er
@c0d0er
Nov 04 2016 04:51
if i click start work circle ($('.bigcir').click(function) multiple times, the timer numbers will be messed, any idea to fix this? http://codepen.io/c0d0er/pen/xRKpGO?editors=1010
Jonathan Maddison
@jonathanwmaddison
Nov 04 2016 04:52
@perseusMyk the return statement for your if statement will stop the function from running as soon as the first shorter string is found in the array.
perseusMyk
@perseusMyk
Nov 04 2016 04:53
@jonathanwmaddison Oh man, that explains a lot ; so the for loop exit one it meet the return statement , right ?
Juwdohr
@Juwdohr
Nov 04 2016 04:55
hey working on a pomodoro clock and the sound works fine on a computer but on a mobile device there is no sound any suggestions?
Jonathan Maddison
@jonathanwmaddison
Nov 04 2016 04:58
@perseusMyk yes exactly. The whole function will stop running once a return statement is met. Basically it tells your function give me whatever value falls after the return statment
Owa Aquino
@owaaquino
Nov 04 2016 04:59
@tjgerot yeah thats the problem i think.. i dunno why it's doing that though
Johnny
@JohnnyBizzel
Nov 04 2016 05:01
@c0d0er Put a check in to test when the clock has started or not.
Richard
@richafig
Nov 04 2016 05:01
Can anyone help with "Increment a Number with JavaScript"? myVar = ++myVar
Matt Fay
@username1001
Nov 04 2016 05:02
@richafig can you post the whole code?
and instructions, please
Johnny
@JohnnyBizzel
Nov 04 2016 05:02
@richafig myVar++
perseusMyk
@perseusMyk
Nov 04 2016 05:02
@jonathanwmaddison thanks alot :)
CamperBot
@camperbot
Nov 04 2016 05:02
perseusmyk sends brownie points to @jonathanwmaddison :sparkles: :thumbsup: :sparkles:
:cookie: 8 | @jonathanwmaddison |http://www.freecodecamp.com/jonathanwmaddison
Richard
@richafig
Nov 04 2016 05:03

Change the code to use the ++ operator on myVar.
var myVar = 87;

// Only change code below this line
myVar = ++myVar;
myVar needs to equal 88

Matt Fay
@username1001
Nov 04 2016 05:04
@richafig , @JohnnyBizzel was correct. myVar=++myVar; should be just myVar++;
c0d0er
@c0d0er
Nov 04 2016 05:04
@JohnnyBizzel what kind of check
Johnny
@JohnnyBizzel
Nov 04 2016 05:05
@c0d0er Use a flag. t/f
Richard
@richafig
Nov 04 2016 05:07
@username1001 Thanks! Now, why is it just myVar++ ?
CamperBot
@camperbot
Nov 04 2016 05:07
richafig sends brownie points to @username1001 :sparkles: :thumbsup: :sparkles:
:cookie: 384 | @username1001 |http://www.freecodecamp.com/username1001
Johnny
@JohnnyBizzel
Nov 04 2016 05:08
@richafig why not? myVar++ ?
c0d0er
@c0d0er
Nov 04 2016 05:10
@JohnnyBizzel thanks
CamperBot
@camperbot
Nov 04 2016 05:10
c0d0er sends brownie points to @johnnybizzel :sparkles: :thumbsup: :sparkles:
:cookie: 742 | @johnnybizzel |http://www.freecodecamp.com/johnnybizzel
Johnny
@JohnnyBizzel
Nov 04 2016 05:10
for (var i = 0; i < myArray.length; i = i + 1)
Meh
Jonathan Maddison
@jonathanwmaddison
Nov 04 2016 05:10
@Lumexralph Hey I got the add function working thanks to your advice but I don't understand how to get it to work with n number of additional numbers. for example add(2)(3)(4)(5) - would return 14
CamperBot
@camperbot
Nov 04 2016 05:10
jonathanwmaddison sends brownie points to @lumexralph :sparkles: :thumbsup: :sparkles:
:warning: jonathanwmaddison already gave lumexralph points
Johnny
@JohnnyBizzel
Nov 04 2016 05:11
@c0d0er :+1:
Richard
@richafig
Nov 04 2016 05:11
@JohnnyBizzel Thank you! I just saw your post.
CamperBot
@camperbot
Nov 04 2016 05:11
richafig sends brownie points to @johnnybizzel :sparkles: :thumbsup: :sparkles:
:cookie: 743 | @johnnybizzel |http://www.freecodecamp.com/johnnybizzel
Jonathan Maddison
@jonathanwmaddison
Nov 04 2016 05:11
Here is my function: function add(x) {
return function(y) {
return x + y;
}
Johnny
@JohnnyBizzel
Nov 04 2016 05:12
@richafig Anytime ;)
harishrepo
@harishrepo
Nov 04 2016 05:12
Hi Can anyone help me with this?

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

// Your code above this line
return result;
}

// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");

Ryan VanDyke
@ryanjvandyke
Nov 04 2016 05:13
yes. you need to put the sentence in order
but you alse have to quote spaces
a space is just that, between quotes
so " "
so to have the return be "Big dog ran quickly" you need
```
Walid Ashri
@walidashri
Nov 04 2016 05:17
I want to kill the guy who introduce npm nothing work without it and not only once :cry:
jens3cakes
@jens3cakes
Nov 04 2016 05:17

var myMusic = [
{
"artist": "Billy Joel",
"title": "Piano Man",
"release_year": 1973,
"formats": [
"CS",
"8T",
"LP" ],
"gold": true
},
[ {
"artist": "Pink",
"title": "Just A Reason",
"release_year": 2010,
"formats": [
"CD",
"iTunes",
"MP3" ],
"gold": true
}]

];

hey guys am I missing something?

harishrepo
@harishrepo
Nov 04 2016 05:18
@ryanjvandyke i didn't get
can you please elaborate
jens3cakes
@jens3cakes
Nov 04 2016 05:19
Never mind, got it!
Walid Ashri
@walidashri
Nov 04 2016 05:19
@jens3cakes it's flat array of objects [{...},{...}]
Ryan VanDyke
@ryanjvandyke
Nov 04 2016 05:19
can you tell me what problem you're on, and send me your code?
@harishrepo
Ryan VanDyke
@ryanjvandyke
Nov 04 2016 05:20
ok yes
so you want the return to say "Big dog ran quickly" correct?
harishrepo
@harishrepo
Nov 04 2016 05:20
yes
Juwdohr
@Juwdohr
Nov 04 2016 05:21
Does anyone know why audio.play() does not work on mobile devices and if there is a work around?
Ryan VanDyke
@ryanjvandyke
Nov 04 2016 05:22
ok so that means you have to have result = followed by the order of which you want your function to fall under
Johnny
@JohnnyBizzel
Nov 04 2016 05:23
@Juwdohr What browser are you using?
Ryan VanDyke
@ryanjvandyke
Nov 04 2016 05:24
so result = one word + " " + another word + " " + another word + " " + last word; @harishrepo
the " " represents a space so it all doesnt come out as one word
but when you input the result =
it has to come from within the funtion, not the actual word itself
does that make sense @harishrepo ?
Walid Ashri
@walidashri
Nov 04 2016 05:25
@Juwdohr I think u gonna need audio library for this
Ryan VanDyke
@ryanjvandyke
Nov 04 2016 05:26
so it should look like this @harishrepo
 result = myAdjective +" "+ myNoun  +" "+ myVerb  +" "+ myAdverb;
not to give you the answer, but sometimes it helps seeing the answer to reference what we weren't exactly getting.
uxdash
@uxdash
Nov 04 2016 05:32
lookupobject.png
Hey guys I'm stuck on the lookup object exercise =(
harishrepo
@harishrepo
Nov 04 2016 05:32
@ryanjvandyke thanks, it works fine.i was confused.
CamperBot
@camperbot
Nov 04 2016 05:32
harishrepo sends brownie points to @ryanjvandyke :sparkles: :thumbsup: :sparkles:
:cookie: 188 | @ryanjvandyke |http://www.freecodecamp.com/ryanjvandyke
Manish Giri
@Manish-Giri
Nov 04 2016 05:33
@uxdash use bracket notation
uxdash
@uxdash
Nov 04 2016 05:33
result = lookup["val"]; ?
Didn't work
c0d0er
@c0d0er
Nov 04 2016 05:34
@walidashri thanks
CamperBot
@camperbot
Nov 04 2016 05:34
c0d0er sends brownie points to @walidashri :sparkles: :thumbsup: :sparkles:
:cookie: 570 | @walidashri |http://www.freecodecamp.com/walidashri
Johnny
@JohnnyBizzel
Nov 04 2016 05:34
@uxdash You spelt delta wrong.
uxdash
@uxdash
Nov 04 2016 05:34
Ah ty, fixed but still not working
Johnny
@JohnnyBizzel
Nov 04 2016 05:36
@uxdash Why?
Ryan VanDyke
@ryanjvandyke
Nov 04 2016 05:36
@harishrepo happens man, epsecially to me haha
uxdash
@uxdash
Nov 04 2016 05:36
No idea
I'm stuck
Walid Ashri
@walidashri
Nov 04 2016 05:37
@JohnnyBizzel thanks and good night
CamperBot
@camperbot
Nov 04 2016 05:37
walidashri sends brownie points to @johnnybizzel :sparkles: :thumbsup: :sparkles:
:cookie: 744 | @johnnybizzel |http://www.freecodecamp.com/johnnybizzel
Johnny
@JohnnyBizzel
Nov 04 2016 05:38
@walidashri Thanks but it's morning :P
CamperBot
@camperbot
Nov 04 2016 05:38
johnnybizzel sends brownie points to @walidashri :sparkles: :thumbsup: :sparkles:
:cookie: 571 | @walidashri |http://www.freecodecamp.com/walidashri
Johnny
@JohnnyBizzel
Nov 04 2016 05:38
@uxdash Your code looked good. Can you copy paste it here again?
uxdash
@uxdash
Nov 04 2016 05:38
Sure
fawfwafa.png
Johnny
@JohnnyBizzel
Nov 04 2016 05:39
@walidashri I can't sleep well at the moment. That;s why I'm here
@uxdash not a screen shot, copy paste it here.
Ian
@toianw
Nov 04 2016 05:40
@uxdash is val a string or a variable/parameter?
Johnny
@JohnnyBizzel
Nov 04 2016 05:40

var ourDecimal = 5.7;

// Only change code below this line

^^ Code
uxdash
@uxdash
Nov 04 2016 05:41

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

// Only change code below this line

  var lookup = {
    "alpha": "Adams",
    "bravo": "Boston",
    "charles": "Chicago",
    "delta": "Denver",
    "echo": "Easy",
    "foxtrot": "Frank"
  };

result = lookup["val"];

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

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

Juwdohr
@Juwdohr
Nov 04 2016 05:41
@JohnnyBizzel I am using Chrome for mobile. but from what I look up audio.play() won't work on iOS or on Andriod either.
uxdash
@uxdash
Nov 04 2016 05:41
@toianw it's the paramter to be passed into the function
I am trying to take that paramater and match it to one of the keys in the lookup dictionary
Juwdohr
@Juwdohr
Nov 04 2016 05:42
@walidashri What do you meand audio library?
Ian
@toianw
Nov 04 2016 05:42
@uxdash then why is it inside quotation marks?
Johnny
@JohnnyBizzel
Nov 04 2016 05:42
@Juwdohr Depends on the file format: http://www.elated.com/articles/html5-audio/
uxdash
@uxdash
Nov 04 2016 05:42
ZOMG
Thanks @toianw
CamperBot
@camperbot
Nov 04 2016 05:42
uxdash sends brownie points to @toianw :sparkles: :thumbsup: :sparkles:
:cookie: 414 | @toianw |http://www.freecodecamp.com/toianw
uxdash
@uxdash
Nov 04 2016 05:43
So JS automatically compares parameter values to strings? What if the parameter were a number and the value to match it to were a string? Type conversion?
Johnny
@JohnnyBizzel
Nov 04 2016 05:45
@uxdash JS is not strict on data types
Juwdohr
@Juwdohr
Nov 04 2016 05:46
@JohnnyBizzel so that actually doesn't help the browser supports the file type i am using but there is no sound it is like it does not get played at all on a mobile device.
Johnny
@JohnnyBizzel
Nov 04 2016 05:47
@Juwdohr What's the site? I will check.
Sorry try it now forgot to fix the code.
It works on my laptop but not on my mobile device.
Manish Giri
@Manish-Giri
Nov 04 2016 05:50
@uxdash result = lookup["val”]; val is a variable, so why the quotes?
Johnny
@JohnnyBizzel
Nov 04 2016 05:51
@Juwdohr You have audio.play() and a function playSound () . How does it work exactly?
Juwdohr
@Juwdohr
Nov 04 2016 05:54
audio.play() was supposed to play a airhorn sound.
Richard
@richafig
Nov 04 2016 05:54

var a = 3;
var b = 17;
var c = 12;

// Only modify code below this line

a = a += 12;
b = 9 += b;
c = c += 7;

IConvert the assignments for a, b, and c to use the += operator.

I think I'm tired, so I am not getting this
Johnny
@JohnnyBizzel
Nov 04 2016 05:56
@richafig a += 12;
b += 9;
Got it yet?
:bulb:
Jonathan Maddison
@jonathanwmaddison
Nov 04 2016 05:58
@richafig "+=" is shorter way of writing for var = var + value. for a += 12 it means a = a+12
(so a = 3 + 12)
Richard
@richafig
Nov 04 2016 05:59
I get that, but it says, "You should use the `+= operator for each variable.
c0d0er
@c0d0er
Nov 04 2016 06:02
in my code i must use 2 timers, but i really want to create only 1 geneal timer for all my code, i know the big circle can only run 1 timer at any time, and both counting1 and counting2 functions have all same codes except the work time and break time value difference, but i cannot find the cross point which can get different work time and break time. any idea for making the only 1 general timer? my code: http://codepen.io/c0d0er/pen/xRKpGO?editors=1010
Richard
@richafig
Nov 04 2016 06:02
@jonathanwmaddison @JohnnyBizzel Thanks. I changed the order of b and it worked. I totally appreciate your help.
CamperBot
@camperbot
Nov 04 2016 06:02
richafig sends brownie points to @jonathanwmaddison and @johnnybizzel :sparkles: :thumbsup: :sparkles:
:cookie: 9 | @jonathanwmaddison |http://www.freecodecamp.com/jonathanwmaddison
:warning: richafig already gave johnnybizzel points
Johnny
@JohnnyBizzel
Nov 04 2016 06:02
@richafig :D
Juwdohr
@Juwdohr
Nov 04 2016 06:04
@JohnnyBizzel If you try it now on a laptop or desktop it works but it you try it on a mobile device it does not. again it is at:
s.codepen.io/juwdohr/debug/rLNLLE
Johnny
@JohnnyBizzel
Nov 04 2016 06:04
@c0d0er I am having a similar problem with my clock. Restarting automatically I have not figured out yet.
jwcha82
@jwcha82
Nov 04 2016 06:23
Hi... I'm having trouble with my freeCodeCamp project 194:

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

Example Output
"-3 Hold"
"5 Bet"

my code:
var count = 0;

function cc(card) {
// Only change code below this line
var posOrNeg = ""; // place holder, now empty;

if (card==2||card==3||card==4||card==5||card==6){
count = count + 1;
}

else if (card==7||card==8||card==9){
count = count;
}

else{
count = count - 1;
}

if(count > 0){
posOrNeg = "Bet";
}
else{
posOrNeg = "Hold";
}

return count + posOrNeg;
// Only change code above this line
}

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

Markus Kiili
@Masd925
Nov 04 2016 06:24
@uxdash All property keys are strings. When you use bracket notation, the engine evaluates the expression inside the brackets and coerces it to a string if it is not a string, and then uses it as the key.
Johnny
@JohnnyBizzel
Nov 04 2016 06:26
@Juwdohr I suspect you have hit a common problem: http://pupunzi.open-lab.com/2013/03/13/making-html5-audio-actually-work-on-mobile/
Make a dedicated App instead!
jwcha82
@jwcha82
Nov 04 2016 06:28
nevermind
Johnny
@JohnnyBizzel
Nov 04 2016 06:29
@jwcha82 You will need a space between [number] and Bet or Hold.
jwcha82
@jwcha82
Nov 04 2016 06:29
yep.. thats what i realized
thank you sir
sorry to bother you
sorry to have bothered you
adilkara
@adilkara
Nov 04 2016 06:30
help please
CamperBot
@camperbot
Nov 04 2016 06:30
no wiki entry for: please
adilkara
@adilkara
Nov 04 2016 06:30
var myStr="I am a \"double quoted"string inside"double quotes".\" ;
can anyone point out the mistake?
Roman Struna
@RomchyFCC
Nov 04 2016 06:33
yes
@adilkara ".\"
Johnny
@JohnnyBizzel
Nov 04 2016 06:33
@adilkara Check how to escape a double quote
Roman Struna
@RomchyFCC
Nov 04 2016 06:33
@adilkara that should be "."
" \ . "
and if that didn't help check the "string inside" part
@adilkara did it work?
@Dreams-link-xiong
Nov 04 2016 06:39
for(var i=0;i<contacts.length;i++){
if(contacts[i].firstName==firstName){
for(var j=1;j<contacts[i].length;j++){
if(contacts[i][j]==prop){
console.log(contacts[i].prop);
}
else{
return'No such property';
}
}
}
else{
return 'No sunch contact';
}
}
I need help. The Profile Lookuo
Johnny
@JohnnyBizzel
Nov 04 2016 06:41
@Dreams-link-xiong Don't return'No such property'; inside the loop
Roman Struna
@RomchyFCC
Nov 04 2016 06:41
" \ . " meant to write \ " . "
Johnny
@JohnnyBizzel
Nov 04 2016 06:42
@RomchyFCC I think he's done one.
Roman Struna
@RomchyFCC
Nov 04 2016 06:42
@JohnnyBizzel yea obviously, but i just couldn't see myself write bad code, had to correct myself it's a pet peeve :S
fredpedro
@fredpedro
Nov 04 2016 06:43
Is it possible to store Basic authentication credentials into the browser using Javascript?
Johnny
@JohnnyBizzel
Nov 04 2016 06:43
@RomchyFCC Attention to detail is a great quality! :+1:
adilkara
@adilkara
Nov 04 2016 06:43
@RomchyFCC no still it doesn't work?
Roman Struna
@RomchyFCC
Nov 04 2016 06:43
@adilkara you have to make 2 quote escapes
@adilkara in the code you presented you only made one
adilkara
@adilkara
Nov 04 2016 06:44
let me try again
@Dreams-link-xiong
Nov 04 2016 06:44
@JohnnyBizzel But where I should put it?
adilkara
@adilkara
Nov 04 2016 06:45
@RomchyFCC how about this[ var myStr="I am a \"double quoted"\ string inside \"double quotes"."; // Change this line]
Aarya Bhorra
@aarya1302
Nov 04 2016 06:46
function destroyer(arr) {
  var array = arr.filter(function(val){
    return val == arguments[1];
  });
  return array;
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Johnny
@JohnnyBizzel
Nov 04 2016 06:46
@Dreams-link-xiong in loop Return if found. else test for if No such property. (store this in a var)
if true return it, else return No such contact
Aarya Bhorra
@aarya1302
Nov 04 2016 06:46
That code return an empty array
motoradk
@motoradk
Nov 04 2016 06:47
Hi everyone, i've got some problem with "Profile Lookup" task
Roman Struna
@RomchyFCC
Nov 04 2016 06:47
you don't need [], it's looking better but you need to construct your escapes correctly...in example \" is correct "\ is not and there is a backspace missing at the end @adilkara
Aarya Bhorra
@aarya1302
Nov 04 2016 06:47
And I want it to return items which are equal to the second argument
Can you guys please help?
Roman Struna
@RomchyFCC
Nov 04 2016 06:48
@motoradk mr @Dreams-link-xiong is currently dealing with this issue, you guys should team up for this one
adilkara
@adilkara
Nov 04 2016 06:49
@RomchyFCC finally! thank you sir
CamperBot
@camperbot
Nov 04 2016 06:49
adilkara sends brownie points to @romchyfcc :sparkles: :thumbsup: :sparkles:
:cookie: 87 | @romchyfcc |http://www.freecodecamp.com/romchyfcc
Roman Struna
@RomchyFCC
Nov 04 2016 06:49
@adilkara good job and no problem thats what this community is for!
Johnny
@JohnnyBizzel
Nov 04 2016 06:50
@aarya1302 First make an array from arguments.
var args = Array.from(arguments);
Aarya Bhorra
@aarya1302
Nov 04 2016 06:51
ok
Thanks @JohnnyBizzel
CamperBot
@camperbot
Nov 04 2016 06:52
aarya1302 sends brownie points to @johnnybizzel :sparkles: :thumbsup: :sparkles:
:cookie: 745 | @johnnybizzel |http://www.freecodecamp.com/johnnybizzel
Johnny
@JohnnyBizzel
Nov 04 2016 06:53
@aarya1302 :+1:
fredpedro
@fredpedro
Nov 04 2016 06:53
Is there a way to store Basic authentication into the browser using Javascript?
Roman Struna
@RomchyFCC
Nov 04 2016 06:56
@fredpedro after a quick search on google which you should have done because you know what you are looking for i came to some information regarding this...it's through use of cookies
Chuks Opia
@9jaswag
Nov 04 2016 07:00
hello guys! I'm on the palindrome algo challenge and I've got no clue whatsoever on what to do. can someone tell me how to get started with it? I know I have to use the replace function to remove non-alphabetic chars before I move everything to lower case then start
Roman Struna
@RomchyFCC
Nov 04 2016 07:02
@JohnnyBizzel is there a way i can use the result of a case in an equation...so case 1: return: 1; case 2: return - 1; how would i make a 0 out of the returns if i ran the code as a series of function calls ? hopefully i made this understandable
D O R C ¥
@Dorcy-ndg3
Nov 04 2016 07:02
@9jaswag start with making a loop
Markus Kiili
@Masd925
Nov 04 2016 07:03
@9jaswag Find a suitable regex to use with replace. Look at \W and \w.
Johnny
@JohnnyBizzel
Nov 04 2016 07:03
@RomchyFCC Use the default case to return 0?
@9jaswag Palindrome reads the same forwards or backwards. Somehow you need to test from the start and finish towards the middle of the string
Roman Struna
@RomchyFCC
Nov 04 2016 07:05
@JohnnyBizzel that wouldn't work because i have 5 function calls which have different returns and i somehow need to combine those returns into a result and i'm not sure if i need to make more variables or is it possible with out them
fredpedro
@fredpedro
Nov 04 2016 07:05
@RomchyFCC I already did my research, I was just hoping you guys have some ideas that I won't find using Google.
Chuks Opia
@9jaswag
Nov 04 2016 07:05
@JohnnyBizzel yeah I figured that out!
Johnny
@JohnnyBizzel
Nov 04 2016 07:05
@RomchyFCC I'm not sure what you mean 2b honest. Code sample?
Roman Struna
@RomchyFCC
Nov 04 2016 07:06
@fredpedro yea i figured as much, i didn't want to sound rude
Johnny
@JohnnyBizzel
Nov 04 2016 07:06
@9jaswag you said " I've got no clue whatsoever on what to do"
Roman Struna
@RomchyFCC
Nov 04 2016 07:06
var count = 0;

function cc(card) {
  // Only change code below this line
  switch (card) {
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
      count = +1;
      break;

    case 7:
    case 8:
    case 9:
      count = 0;
      break;


    case 10:
    case 'J':
    case 'Q':
    case 'K':
    case 'A':
      count = -1;
      break;
  }
  if (count + count + count <= -1) {
    return count +" Hold";
  }  else if (count + count + count === 0) {
    return count + " Hold";
  } else if (count + count + count >= 1) {
    return count + " Bet";
  }
  // Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(6); cc(6); cc(7); cc('K'); cc(6);
this is how far i've come, it works but it only uses the value of the last function call @JohnnyBizzel
Johnny
@JohnnyBizzel
Nov 04 2016 07:07
@RomchyFCC Oh you are on that one! You are making it much harder than it needs to be.
if (count <= -1) will do
Roman Struna
@RomchyFCC
Nov 04 2016 07:07
@JohnnyBizzel never was much of an occam's razor guy
@JohnnyBizzel ofcourse, silly me, but i still need to make the program count the return of each of the five valuse passed in the call
Johnny
@JohnnyBizzel
Nov 04 2016 07:09
@RomchyFCC Because count is Global, it gets changed each time you call the function. It has a global scope
Roman Struna
@RomchyFCC
Nov 04 2016 07:09
@JohnnyBizzel is it possible to make it a variable? (i feel like i should test this and learn from that)
Markus Kiili
@Masd925
Nov 04 2016 07:09
@9jaswag There is a very beautiful palindrome is Finnish "naama anna maalaa ja maalasi salaa majaa laaman naamaan". You can practice on it.
Johnny
@JohnnyBizzel
Nov 04 2016 07:10
@RomchyFCC Make what a variable?
@Masd925 :O And what does that mean?
Roman Struna
@RomchyFCC
Nov 04 2016 07:10
@JohnnyBizzel i just realized that count is already a variable hahaha oh my god, i'm gonna reset the code, thanks for waking me up with your confusion :D
CamperBot
@camperbot
Nov 04 2016 07:10
romchyfcc sends brownie points to @johnnybizzel :sparkles: :thumbsup: :sparkles:
:cookie: 746 | @johnnybizzel |http://www.freecodecamp.com/johnnybizzel
Johnny
@JohnnyBizzel
Nov 04 2016 07:11
@RomchyFCC Anytime :+1: :D
Markus Kiili
@Masd925
Nov 04 2016 07:11
@JohnnyBizzel Roughly: "Face-Anna was painting and painted secretly a hut into llamas face"
Johnny
@JohnnyBizzel
Nov 04 2016 07:11
@Masd925 Ha ha brilliant :D
Markus Kiili
@Masd925
Nov 04 2016 07:12
@JohnnyBizzel It sounds nice.
Chuks Opia
@9jaswag
Nov 04 2016 07:13
@JohnnyBizzel yeah. what I meant is how to start with the code
Johnny
@JohnnyBizzel
Nov 04 2016 07:13
@9jaswag Another one you can try " Was it Eliot's toilet I saw?"
@9jaswag How about: string - to array, split down the middle. reverse one side, if equal then palindrome. Remembering to ignore all the strange characters with a regular expression test.
Simple ;)
kirbyedy
@kirbyedy
Nov 04 2016 07:16
@Masd925 lol
Chuks Opia
@9jaswag
Nov 04 2016 07:16
arrgh RegExp...I was expecting there'll be diff solution that won't invole regex...still haven't found a comprehensive tutorial that will make me understand it well @JohnnyBizzel
c0d0er
@c0d0er
Nov 04 2016 07:22
does anybody know why when i click the big start circle multiple times, then when i first click pause button, it doesnt work, then only click it the 2nd time, it pauses? http://codepen.io/c0d0er/pen/xRKpGO?editors=1010
adilkara
@adilkara
Nov 04 2016 07:30
var myStr ="FirstLine \n SecondLine \r ThirdLine";
what is wong with above line
help
Ryan VanDyke
@ryanjvandyke
Nov 04 2016 07:32
if (val > 10 || val <20 ) {
    return "Outside";
  }



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

testLogicalOr(10) should return "Inside"

testLogicalOr(15) should return "Inside"

testLogicalOr(19) should return "Inside"

testLogicalOr(20) should return "Inside"

how come none of these are returning inside when I run the code?

bensch5000
@bensch5000
Nov 04 2016 07:33
Use &&
instead of ||
Ryan VanDyke
@ryanjvandyke
Nov 04 2016 07:33
but it says to use || once
bensch5000
@bensch5000
Nov 04 2016 07:33
|| means or, the value only have to be greater 10 OR lower 20, all values are that
useval < 10 || val > 20
Ryan VanDyke
@ryanjvandyke
Nov 04 2016 07:35
oh i see, i was just doing it backwards. thanks @bensch5000
CamperBot
@camperbot
Nov 04 2016 07:35
ryanjvandyke sends brownie points to @bensch5000 :sparkles: :thumbsup: :sparkles:
:cookie: 280 | @bensch5000 |http://www.freecodecamp.com/bensch5000
bensch5000
@bensch5000
Nov 04 2016 07:35
welcome ;) @ryanjvandyke
Owa Aquino
@owaaquino
Nov 04 2016 07:46
hello I already asked this earlier on the thread. I have this project that seem's cannot figure out why I cannot use the "Cancel" button properly. (You'll need to click the "Edit" button first to see the cancel button).
in the cancelAction function how come it's returning undefined?
bahaa aldin
@bahaa-al-deen
Nov 04 2016 07:48

function destroyer(arr) {
  var k = 1;
  for (i=0; i<arr.length; i++) {
    if(arr[i] == arguments[k]) {
       arr[i] = 0;
    }
    k++;
  }

  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
hey guys .. what did i miss ?
the loop isn't working
Markus Kiili
@Masd925
Nov 04 2016 07:48
@BahaaZidan You need to loop or iterate the arguments.
bahaa aldin
@bahaa-al-deen
Nov 04 2016 07:48
and the array get returned as original
@Masd925 i did
with the k
Markus Kiili
@Masd925
Nov 04 2016 07:50
@BahaaZidan Setting element to 0 is not removing it.
bahaa aldin
@bahaa-al-deen
Nov 04 2016 07:51
im not trying to
ill set them to 0 then ill filter them
i have a specific problem now
Markus Kiili
@Masd925
Nov 04 2016 07:52
@BahaaZidan You are not comparing an arr element to all arguments. You need two nested loops or iterations.
You are comparing an arr element to only one argument.
bahaa aldin
@bahaa-al-deen
Nov 04 2016 07:53
how will i be able to iterate through both ?
Markus Kiili
@Masd925
Nov 04 2016 07:53
If you plan to use filter, put the logic inside filter callback: return arr.filter(function(elem){...});
Inside the callback, loop or iterate the arguments.
bahaa aldin
@bahaa-al-deen
Nov 04 2016 07:54
can i loop inside the callback function ??
Markus Kiili
@Masd925
Nov 04 2016 07:54
Yes.
bahaa aldin
@bahaa-al-deen
Nov 04 2016 07:55
thanks m8 ,, ill tweak the code and come back with the soln :+1:
Markus Kiili
@Masd925
Nov 04 2016 07:55
@BahaaZidan Remember that the callback function has its own arguments object.
bahaa aldin
@bahaa-al-deen
Nov 04 2016 07:56
yeah i know
so ill have to define another function outside
Markus Kiili
@Masd925
Nov 04 2016 07:57
You can store destroyers arguments on a variable or use filter syntax for passing destroyers arguments into the callback as value of this.
arr.filter(callback[, thisArg])
It is also possible to turn arguments into an array and solve it by using array methods.
The old way of accessing outer functions arguments destroyer.arguments is deprecated.
RakeshNerkar
@Rakesh18754
Nov 04 2016 07:59
I am appending a div on click of a button to a container which is allready present on the web page
 but when i use the on click bubble event till the body it works fine

 $('body').on( "click", "#addChartPopUp", function() {
    console.log("event binded");
 }); 

 and when i replace body with id = widgetDiv  which is allready present in the dom it does not work

 $('#widgetDiv').on( "click", "#addChartPopUp", function() {
    console.log("event binded");
 });

 pls tell me what i am doing wrong in this ?
D O R C ¥
@Dorcy-ndg3
Nov 04 2016 08:04
@Masd925 hey i have a question... i already passed this test but i wanted to try it with a different approach but its now not passing wondering if u can figure out where i went wrong
function largestOfFour(arr) {
newArray = [];
  for (var i=0; i<arr.length; i++){
    for(var j=0; j<arr.length; j++){
      return newArray.push(biggestNum);

  }}
return newArray;
}


function biggestNum(array) {
      return Math.max.apply(null, array);
       }
Markus Kiili
@Masd925
Nov 04 2016 08:07
@Dorcy-ndg3 You only need one loop there.
Math max.apply does the second looping.
D O R C ¥
@Dorcy-ndg3
Nov 04 2016 08:07
i thought i needed two cause of the sub-arays
lemme change that
it just returns 1 this time ???
Markus Kiili
@Masd925
Nov 04 2016 08:08
@Dorcy-ndg3 You also need to pass the subarray to the helper function.
D O R C ¥
@Dorcy-ndg3
Nov 04 2016 08:08
sorry !!!!
please illustrate what u mean
Markus Kiili
@Masd925
Nov 04 2016 08:09
@Dorcy-ndg3 You loop through arr, so arr[i] is one subarray. Then you pass it to biggestNum and get the largest number. You push it to the result array.
@Dorcy-ndg3 Also use var when you declare newArray.
D O R C ¥
@Dorcy-ndg3
Nov 04 2016 08:15
@Masd925 u mean i do tbis to my function ??
function biggestNum(arr[i]){ return Math.max.apply(null, arr[1]); }
is that wat u mean
Markus Kiili
@Masd925
Nov 04 2016 08:16
@Dorcy-ndg3 No, the biggestNum function is fine.
D O R C ¥
@Dorcy-ndg3
Nov 04 2016 08:16
so where do i use arr[1] ??
Markus Kiili
@Masd925
Nov 04 2016 08:16
I mean newArray.push(biggestNum(arr[i]))
MM Nauman
@mmnauman
Nov 04 2016 08:17
Hello Any One Explain Me convert from Celsius to Fahrenheit
D O R C ¥
@Dorcy-ndg3
Nov 04 2016 08:17
it still gives me 1
Markus Kiili
@Masd925
Nov 04 2016 08:17
@Dorcy-ndg3 Did you remove the second loop?
Post the code again.
D O R C ¥
@Dorcy-ndg3
Nov 04 2016 08:18
function largestOfFour(arr) {
var newArray = [];
  for (var i=0; i<arr.length; i++){

      return newArray.push(biggestNum(arr[i]));

  }
return newArray;
}


function biggestNum(array) {
      return Math.max.apply(null, array);
       }
Markus Kiili
@Masd925
Nov 04 2016 08:18
@Dorcy-ndg3 Remove the first return.
You only return at the end of function.
D O R C ¥
@Dorcy-ndg3
Nov 04 2016 08:18
yesss thanks @Masd925 it passed
CamperBot
@camperbot
Nov 04 2016 08:18
dorcy-ndg3 sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 2832 | @masd925 |http://www.freecodecamp.com/masd925
Markus Kiili
@Masd925
Nov 04 2016 08:18
Inside the loop you just push a number to the result array.
D O R C ¥
@Dorcy-ndg3
Nov 04 2016 08:19
@mmnauman what were ur instructions
MM Nauman
@mmnauman
Nov 04 2016 08:19

To test your learning, you will create a solution "from scratch". Place your code between the indicated lines and it will be tested against multiple test cases.

The algorithm to convert from Celsius to Fahrenheit is the temperature in Celsius times 9/5, plus 32.

You are given a variable celsius representing a temperature in Celsius. Use the variable fahrenheit already defined and apply the algorithm to assign it the corresponding temperature in Fahrenheit.

this are the instructions
Markus Kiili
@Masd925
Nov 04 2016 08:19
@Dorcy-ndg3 With methods there are even simpler solutions: function largestOfFour(arr){return arr.map(biggestNum);}
Ogundele Olumide
@Lumexralph
Nov 04 2016 08:20
@mmnauman what're you to do?
MM Nauman
@mmnauman
Nov 04 2016 08:20
convertToF(0) should return a number
convertToF(-30) should return a value of -22
convertToF(-10) should return a value of 14
convertToF(0) should return a value of 32
convertToF(20) should return a value of 68
convertToF(30) should return a value of 86
Ogundele Olumide
@Lumexralph
Nov 04 2016 08:20
You're to first create a function that takes in a variable
D O R C ¥
@Dorcy-ndg3
Nov 04 2016 08:21
assign any temp in celcious then multiply it by 9/5 and add 32 like the instructions say @mmnauman
@Masd925 so wen i use map i dont have to use arr[i] ??
Ogundele Olumide
@Lumexralph
Nov 04 2016 08:21
@mmnauman then you apply the formula of converting Celsius to Fahrenheit to that parameter you passed to the function like @Dorcy-ndg3 pointed
MM Nauman
@mmnauman
Nov 04 2016 08:21
I have Added Only The Last three are not getting right values @Dorcy-ndg3
Markus Kiili
@Masd925
Nov 04 2016 08:22
@Dorcy-ndg3 Yes, map does the looping through arr. That code tells map to make a new array where all arr elements are mapped to largest numbers of those arr elements.
D O R C ¥
@Dorcy-ndg3
Nov 04 2016 08:22
@mmnauman paste ur code here
@Masd925 so i wudnt even have to create a new array where i want my new elements
Markus Kiili
@Masd925
Nov 04 2016 08:23
@Dorcy-ndg3 In general, if you need to transform each array element to something else, you use map. Here you transform each array to the largest number of that array.
Ogundele Olumide
@Lumexralph
Nov 04 2016 08:24
@mmnauman multiply 9/5 to the parameter of your function, keep the result and add 32 to the result and you return the result
Markus Kiili
@Masd925
Nov 04 2016 08:24
@Dorcy-ndg3 No, map does it under the hood and returns that new array.
MM Nauman
@mmnauman
Nov 04 2016 08:26
@Lumexralph Thank you So Much Now i got it
CamperBot
@camperbot
Nov 04 2016 08:26
mmnauman sends brownie points to @lumexralph :sparkles: :thumbsup: :sparkles:
:cookie: 405 | @lumexralph |http://www.freecodecamp.com/lumexralph
Ogundele Olumide
@Lumexralph
Nov 04 2016 08:26
@Masd925 one of the stuffs i enjoy with js is the plethora og methods for manipulation of datatype
D O R C ¥
@Dorcy-ndg3
Nov 04 2016 08:27
@Masd925 check this out

function largestOfFour(arr) {


     arr.map(biggestNum);

  }
return arr;
}


function biggestNum(array) {
      return Math.max.apply(null, array);
       }


largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Ogundele Olumide
@Lumexralph
Nov 04 2016 08:27
@mmnauman you're welcome
D O R C ¥
@Dorcy-ndg3
Nov 04 2016 08:27
not passing
Markus Kiili
@Masd925
Nov 04 2016 08:27
@Dorcy-ndg3 map returns a new array that you don't use. Do return arr.map(...
D O R C ¥
@Dorcy-ndg3
Nov 04 2016 08:28
its worked
so map iterates through the array then creates a new array for the maximum numbers
wow thios is smooth
my first solution was about 8 lines of code
Markus Kiili
@Masd925
Nov 04 2016 08:29
@Dorcy-ndg3 Yes, map passes each arr element into the function you provide biggestNum and puts the return values into the returned array.
D O R C ¥
@Dorcy-ndg3
Nov 04 2016 08:29
but this one about 4
thanks again @Masd925
CamperBot
@camperbot
Nov 04 2016 08:30
dorcy-ndg3 sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:warning: dorcy-ndg3 already gave masd925 points
Johnny
@JohnnyBizzel
Nov 04 2016 08:30
.map() is a kind of 'for each item of array' loop.
Markus Kiili
@Masd925
Nov 04 2016 08:30
@Dorcy-ndg3 Writing a named function is fine, but another way is to make an anonymous function:
function largestOfFour(arr) {
  return arr.map(function(innerArray){
    return Math.max.apply(null,innerArray);
  });  
}
D O R C ¥
@Dorcy-ndg3
Nov 04 2016 08:41
thanks alot thats gonna save me a lot of work
Ramsey Darling
@Ramsanine
Nov 04 2016 08:50
I am having some trouble with the "Record Collection" challenge in the basic JavaScript training?
Phillip Kelley-Dotson
@pkdotson
Nov 04 2016 08:50

function truncateString(str, num) {
// Clear out that junk in your trunk
var newStr = length;
if(str.length > num){
return str.slice(0, num) + "...";
}else if (str.length <= 3) {
return str + "...";
}

}

truncateString("A-tisket a-tasket A green and yellow basket", 11);
Am i on the right path?

kirbyedy
@kirbyedy
Nov 04 2016 08:51
var newStr = length; what does this do ?
Ramsey Darling
@Ramsanine
Nov 04 2016 08:53

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

@kirbyedy That declares a variable with the name newStr with a value of length

Phillip Kelley-Dotson
@pkdotson
Nov 04 2016 08:53
@kirbyedy i'm not sure. I read a clue that said i need a variable store.
kirbyedy
@kirbyedy
Nov 04 2016 08:54
ok, and what is the value of length ? where is it defined ?
Phillip Kelley-Dotson
@pkdotson
Nov 04 2016 08:55
@kirbyedy .length? lol
Ramsey Darling
@Ramsanine
Nov 04 2016 08:55
Are you trying to get the the length of that variable?
Can anyone help me with "Record Collection".
Ghulam Shabir
@ghulamshabir
Nov 04 2016 08:59
@pkdotson your second if should be nested if inside first if without else, in that if test if num is greater than 3 then subtract three from num when slicing lke this slice(0, num -3) else slice without subtracting like this slice(0, num), now close your first top if, add else part to it return str
Phillip Kelley-Dotson
@pkdotson
Nov 04 2016 09:00

@Ramsanine function updateRecords(id, prop, value) {

if (value === '') {
delete collection[id][prop];
} else if (prop !== 'tracks') {
collection[id][prop] = value;
} else {
if (collection[id][prop] === undefined){
collection[id][prop] = [];
}
collection[id][prop].push(value) ;
}

return collection;
}

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

Ghulam Shabir
@ghulamshabir
Nov 04 2016 09:00
@Ramsanine id and prop are variables you can not use variables in dot notations
D O R C ¥
@Dorcy-ndg3
Nov 04 2016 09:00
@Ramsanine ur code needs return statements
Phillip Kelley-Dotson
@pkdotson
Nov 04 2016 09:02
thanks @ghulamshabir
CamperBot
@camperbot
Nov 04 2016 09:02
pkdotson sends brownie points to @ghulamshabir :sparkles: :thumbsup: :sparkles:
:cookie: 846 | @ghulamshabir |http://www.freecodecamp.com/ghulamshabir
Ghulam Shabir
@ghulamshabir
Nov 04 2016 09:02
@pkdotson :+1:
knappsacks
@knappsacks
Nov 04 2016 09:09

Struggling here. I am trying to change an element using jquery, and giving the element a new id, which can then be changed by another function in jquery. But once it changes the first time, the jquery function that targets the new element doesn't work.

Here's a demo on codepen - http://codepen.io/knappsacks/pen/rWNzoe

I don't get why the 2nd jquery function doesn't work? Any ideas?

Hammad Amin
@hammad-amin
Nov 04 2016 09:09
I have to build a random quote machine.
https://codepen.io/FreeCodeCamp/full/ONjoLe/
I am very confused about where to start. Is there a way to get data from another website which has quotes or do I have to build my own by putting all the quotes in to arrays and some how finding a way to display a random quote on clicking a button?
D O R C ¥
@Dorcy-ndg3
Nov 04 2016 09:12
hey guys i would like to know why this leaves out some tests failing
function confirmEnding(str, target) {
  if (str.substr(-1) != target) {
  return false;
  }
  else {
    return true;
  }
}
@Masd925 are u still there ???
Ghulam Shabir
@ghulamshabir
Nov 04 2016 09:14
@hammad-amin try this quotes api
@hammad-amin that api will return different quote on each request
Hammad Amin
@hammad-amin
Nov 04 2016 09:16
whenever reloaded?
Ghulam Shabir
@ghulamshabir
Nov 04 2016 09:16
@hammad-amin open it multiply times in your browser and you will see different quote every time
Hammad Amin
@hammad-amin
Nov 04 2016 09:17
I dont understand APIs at all. @ghulamshabir
Ghulam Shabir
@ghulamshabir
Nov 04 2016 09:17
@hammad-amin do you understand js objects in {} ?
Hammad Amin
@hammad-amin
Nov 04 2016 09:19
@ghulamshabir Yes
herbie vd berg
@herbievdberg
Nov 04 2016 09:19
how do i assign a variable to another variable?
Hammad Amin
@hammad-amin
Nov 04 2016 09:22
@ghulamshabir any resources about how APIs work? On how JS works as a whole?
Ken Haduch
@khaduch
Nov 04 2016 09:22
@herbievdberg - using an = operator. var myVar = otherVar; assigns value in "otherVar" to "myVar".
Ghulam Shabir
@ghulamshabir
Nov 04 2016 09:22
@hammad-amin when you call an api like this $.getJSON("api url", function(data) {} ) it will return the object you see in your browser as data variable in the callback function got it?
Hammad Amin
@hammad-amin
Nov 04 2016 09:24
@ghulamshabir can you give an example?
Tim
@agentatomic
Nov 04 2016 09:24
@Dorcy-ndg3 some of them will be wrong because the targets are words and not just the last letter
D O R C ¥
@Dorcy-ndg3
Nov 04 2016 09:24
@agentatomic i figured that out thanks fam
CamperBot
@camperbot
Nov 04 2016 09:24
dorcy-ndg3 sends brownie points to @agentatomic :sparkles: :thumbsup: :sparkles:
:cookie: 267 | @agentatomic |http://www.freecodecamp.com/agentatomic
Tim
@agentatomic
Nov 04 2016 09:25
np, didnt realise you asked so long ago, just came into the chat :D
Ghulam Shabir
@ghulamshabir
Nov 04 2016 09:25
@hammad-amin when you open the url i have you in a browser you will see objects in an array like this
[{"ID":1294,"title":"Gerry McGovern","content":"<p>Traditional marketing is often seeing is getting people to do things but I think web marketing is about helping people do things.  <\/p>\n","link":"https:\/\/quotesondesign.com\/gerry-mcgovern\/","custom_meta":{"Source":"<a href=\"http:\/\/boagworld.com\/podcast\/194\">podcast<\/a>"}}]
Hammad Amin
@hammad-amin
Nov 04 2016 09:26
@ghulamshabir Yes exactly
herbie vd berg
@herbievdberg
Nov 04 2016 09:26
@khaduch so if i have var a=7 and var b=7 how do i assign a to b
Ghulam Shabir
@ghulamshabir
Nov 04 2016 09:27
@hammad-amin that array will be available to you, it will be assigned to data parameter of the callback of getJSON
@hammad-amin you can console.log(data) and see the array in codepen console
Ken Haduch
@khaduch
Nov 04 2016 09:29
@herbievdberg - if both variables already are declared, you use the = operator and assign b = a; In this situation, they both will have the same value at the start and afterwards.
@herbievdberg - it will be a third line of code, in your example.
Hammad Amin
@hammad-amin
Nov 04 2016 09:31
So these APIs are pre-built and do everything by themselves?