These are chat archives for FreeCodeCamp/HelpJavaScript

28th
Jan 2017
Max
@UkrainianProtein
Jan 28 2017 00:00
@JLuboff I don't see anything in revs gists about the countine cards
Stephen James
@sjames1958gm
Jan 28 2017 00:00
@Humphreyj so that if a or b are less than 0 the function will immediately exit with a value of undefined.
start with this if
Max
@UkrainianProtein
Jan 28 2017 00:00
@JLuboff Well then I 100% don't understand the instructions
Dan
@MindWhys
Jan 28 2017 00:00
how come the other Boolean values of "0", "", flase etc are filtered out?
Joseph Uchenna
@afrikhero
Jan 28 2017 00:00
@JLuboff please check this out
```
Joshua Humphrey
@Humphreyj
Jan 28 2017 00:01
@sjames1958gm that's what i suspected. Slowly figuring it out, thank.
CamperBot
@camperbot
Jan 28 2017 00:01
humphreyj sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 5560 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Joseph Uchenna
@afrikhero
Jan 28 2017 00:01
@JLuboff please check this out

//Setup
var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intriguing Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    }
];


function lookUpProfile(firstName, prop){
// Only change code below this line

if (contacts.hasOwnProperty(firstName) === true && contacts.hasOwnProperty(prop) === true){
  return contacts[i].prop;
}
  else if (firstName != contacts[firstName]){
    return "No such contact";
  }
  else if (contacts.hasOwnProperty(prop) === false){
    return "No such property";
  }

// Only change code above this line
}

// Change these values to test your function
lookUpProfile("Akira", "likes");
Stephen James
@sjames1958gm
Jan 28 2017 00:01
@MindWhys Boolean converts values from truthy or falsey to true or false.
@afrikhero contacts is an array you need to consider a loop
@MindWhys When the function called by filter returns false for an element the element is not included in the output
Gema Anggada | Гема Анггада
@heygema
Jan 28 2017 00:03

function lookUpProfile(firstName, prop){
// Only change code below this line
  result = "";
  for(var i in contacts){
    if(contacts[i].firstName === firstName) {
       if( contacts[i].hasOwnProperty(prop)) {
         result = contacts[i][prop];
       }

      else {
        result = "No such property";
      }
    }

    else if(contacts[i].firstName != firstName ){
      result = "No such contact";
    }  


   }

  return result;
// Only change code above this line
}
Max
@UkrainianProtein
Jan 28 2017 00:03
@JLuboff if anything I'll just go grab a coffee and head back home and hopefully rev will be here when I get back home in like an hour or two
Dan
@MindWhys
Jan 28 2017 00:03
is true not still a Boolean value? @sjames1958gm and why don't "NaN" and "undefined" return false and therefore get filtered even though they are falsy?
Stephen James
@sjames1958gm
Jan 28 2017 00:03
@heygema Wont this give you the result of the last contact?
@MindWhys Are you talking about the commented out code?
Gema Anggada | Гема Анггада
@heygema
Jan 28 2017 00:04
@sjames1958gm yes, why is that ?
Stephen James
@sjames1958gm
Jan 28 2017 00:04
@heygema So if you match the first name you should stop looping?
Dan
@MindWhys
Jan 28 2017 00:04
I'm talking about both...let's take one at a time...True is a Boolean value...yes?
Gema Anggada | Гема Анггада
@heygema
Jan 28 2017 00:05
@sjames1958gm yes, what should I do to keep the loop until find it ?
Stephen James
@sjames1958gm
Jan 28 2017 00:05
@heygema You mean stop looping? You can break; when the firstName matches
@MindWhys true is a boolean value.
Gema Anggada | Гема Анггада
@heygema
Jan 28 2017 00:06
@sjames1958gm is it using switch case ?
Stephen James
@sjames1958gm
Jan 28 2017 00:06
@heygema break; is valid in for loops if you want to exit the loop
Dan
@MindWhys
Jan 28 2017 00:06

@sjames1958gm and this line of code

return arr.filter(Boolean);

filters out all boolean values?

Gema Anggada | Гема Анггада
@heygema
Jan 28 2017 00:06
@sjames1958gm wow thank you !
CamperBot
@camperbot
Jan 28 2017 00:06
heygema sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 5561 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Jan 28 2017 00:07
@MindWhys No - it filters out falsey values because Boolean(val) returns false if val is falsey
Sion Chen
@sionchen86
Jan 28 2017 00:07
Hello. Could someone help me out with a challenge? I'm not sure I completely understand what it's asking.
Dan
@MindWhys
Jan 28 2017 00:08
@sjames1958gm how does the filter know to focus on falsy values rather than truthy ones?
Stephen James
@sjames1958gm
Jan 28 2017 00:08
@MindWhys It doesn't it calls Boolean for all the values - Boolean(val) returns true for truthy values which filter then puts in the output array
Dan
@MindWhys
Jan 28 2017 00:09
@sjames1958gm What if I wanted to filter out all the truthy values and keep the falsy ones?
Stephen James
@sjames1958gm
Jan 28 2017 00:09
@sionchen86 Ask your question
Sion Chen
@sionchen86
Jan 28 2017 00:10
@sjames1958gm I'm stuck at challenge "Escape Sequences in Strings"
Stephen James
@sjames1958gm
Jan 28 2017 00:10
@MindWhys You would have to use a different function. You could do function(val) { return !Boolean(val); } which gives the opposite behavior
Sion Chen
@sionchen86
Jan 28 2017 00:10
@sjames1958gm "myStr should have encoded text with the proper escape sequences and no spacing."
Stephen James
@sjames1958gm
Jan 28 2017 00:10
@sionchen86 copy the test string into a string in the editor - then replace the four keywords with values from the table
Then remove all spaces.
Dan
@MindWhys
Jan 28 2017 00:10
@sjames1958gm cool, I thought something like that might be the case...so Javascript auto-assumes you want to keep truthy values
Stephen James
@sjames1958gm
Jan 28 2017 00:11
@MindWhys Filter keeps values where the called function return true - yes
Dan
@MindWhys
Jan 28 2017 00:11
@sjames1958gm thanks, I just wanted clarification on that...I don't like to assume these things
CamperBot
@camperbot
Jan 28 2017 00:11
mindwhys sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 5562 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Jan 28 2017 00:12
@MindWhys no prob. good questions
Sion Chen
@sionchen86
Jan 28 2017 00:12
@sjames1958gm thanks, ill try that
CamperBot
@camperbot
Jan 28 2017 00:12
sionchen86 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 5563 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Joseph Uchenna
@afrikhero
Jan 28 2017 00:12
@heygema u got now?
Matthew Bailin
@mdbailin
Jan 28 2017 00:12
Hey does anyone know how to alphabatize a 2d array?
This is what I have so far
Dan
@MindWhys
Jan 28 2017 00:13
@sjames1958gm how about the commented out piece of code...it worked for falsy values like "false", 0, "", etc...filtering them out as expected...however, the values "Nan" and "undefined" were returned as null...why is that?
Matthew Bailin
@mdbailin
Jan 28 2017 00:13
function alphabatize (a,b){
  a = a[1];
  b = b[1];
  return (a === b) ? 0 : (a < b) ? -1 : 1;
}
Stephen James
@sjames1958gm
Jan 28 2017 00:15
@MindWhys 1) splice used in a loop can be misleading - because you reduce the size of the array while increasing i
Not sure what arr[i] === Boolean is going to do because Boolean is a function - so it should be false for
every case
Matthew Bailin
@mdbailin
Jan 28 2017 00:15
also
function updateInventory(arr1, arr2) {
    // All inventory must be accounted for or you're fired!

  arr1.push(arr2);
  arr1.sort(alphabatize);
  return arr1;
}
Stephen James
@sjames1958gm
Jan 28 2017 00:16
@mdbailin Is it an array of strings?
Also you want to concat not push or you create another level of array for arr2
Ken Haduch
@khaduch
Jan 28 2017 00:16
@mdbailin - are you permitted to use the sort method? If so, look at the documentation here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort - scroll down for the technique to sort alphabetic strings.
Dan
@MindWhys
Jan 28 2017 00:16
I actuall started out that line as
if (arr[i] === false || "" || 0 etc.) {
arr.splice(i, 1);
}
Matthew Bailin
@mdbailin
Jan 28 2017 00:17
The array must remain 2d
Stephen James
@sjames1958gm
Jan 28 2017 00:17
@MindWhys Yeah that is (arr[1] === false) or "" or 0
which is not what you wanted.
Ken Haduch
@khaduch
Jan 28 2017 00:17
@mdbailin - I see that you are using sort - check that documentation for the proper way to sort alphabetic strings. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort
Dan
@MindWhys
Jan 28 2017 00:18
@sjames1958gm ah, so because I was reducing the array size while increasing the count I was ending up skipping element of the array
Stephen James
@sjames1958gm
Jan 28 2017 00:19

@MindWhys Yes. BEcause of the nature of if (converts the expression to boolean

if (!arr[i]) {
   arr.splice(i, 1);
   i--
}

decrement i here fixes the skip

Matthew Bailin
@mdbailin
Jan 28 2017 00:19
@khaduch I have seen the docs on this, the issue is how to sort for a 2d array now
@sjames1958gm concat just causes arr2 to disappear
Stephen James
@sjames1958gm
Jan 28 2017 00:19
@mdbailin You idea is correct.
Dan
@MindWhys
Jan 28 2017 00:19
@sjames1958gm I was about to ask if I could have solved that element of the problem by adding i-- :)
Stephen James
@sjames1958gm
Jan 28 2017 00:20
@MindWhys :)
Dan
@MindWhys
Jan 28 2017 00:20
@sjames1958gm Thanks for the explanations...I hate getting a solution that results in more questions than answers.
CamperBot
@camperbot
Jan 28 2017 00:20
mindwhys sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:warning: mindwhys already gave sjames1958gm points
Stephen James
@sjames1958gm
Jan 28 2017 00:20
@mdbailin You want the two arrays 2d arrays to become 1 2d array? Concat will do that, push will not
Sion Chen
@sionchen86
Jan 28 2017 00:20
@sjames1958gm Thanks Stephen, weird I thought I wrote the same solution, but I typed it out before. Guess I made a mistake somewhere.
CamperBot
@camperbot
Jan 28 2017 00:20
sionchen86 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:warning: sionchen86 already gave sjames1958gm points
Matthew Bailin
@mdbailin
Jan 28 2017 00:21
@sjames1958gm oh I just tried something and something good happened
Stephen James
@sjames1958gm
Jan 28 2017 00:21
@sionchen86 Best to copy paste strings, typos are often problems
@mdbailin :laughing:
Ken Haduch
@khaduch
Jan 28 2017 00:21
@mdbailin - search that documentation for this string: "Objects can be sorted given the value of one of their properties." Shows that you can do something in your function to select a subset of the data to sort on - just use the appropriate array index when access the data for comparison.
Matthew Bailin
@mdbailin
Jan 28 2017 00:21
function alphabatize (a,b){
  a = a[1];
  b = b[1];
  return (a === b) ? 0 : (a < b) ? -1 : 1;
}


function updateInventory(arr1, arr2) {
    // All inventory must be accounted for or you're fired!

  var x = arr1.concat(arr2);
  x.sort(alphabatize);
  return x;
}
Sion Chen
@sionchen86
Jan 28 2017 00:21
@sjames1958gm gotcha
Matthew Bailin
@mdbailin
Jan 28 2017 00:22
And now the output is
Eaten Apple"],[5,"Microphone"],[7,"Toothpaste"]]
Sorry output is cutting off for some reason
Stephen James
@sjames1958gm
Jan 28 2017 00:23
@mdbailin you could use localeCompare and save a string compare - but your basic structure is correct
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare
Matthew Bailin
@mdbailin
Jan 28 2017 00:23
[[21,"Bowling Ball"],[67,"Bowling Ball"],[2,"Dirty Sock"],[1,"Hair Pin"],[2,"Hair Pin"],[3,"Half-Eaten Apple"],[5,"Microphone"],[7,"Toothpaste"]]
That's what the output looks like
I'm on the right track now I think haha
Stephen James
@sjames1958gm
Jan 28 2017 00:24
@mdbailin :+1:
Matthew Bailin
@mdbailin
Jan 28 2017 00:24
thanks @sjames1958gm
CamperBot
@camperbot
Jan 28 2017 00:24
:star2: 5564 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
mdbailin sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
Joseph Uchenna
@afrikhero
Jan 28 2017 00:29
@sjames1958gm am still stucked. I tried using a loop statement

//Setup
var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intriguing Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    }
];


function lookUpProfile(firstName, prop){
// Only change code below this line
  for(var i in contacts){

if (contacts[i].firstName === firstName){
  if(contacts[i].hasOwnProperty()){
  return contacts[i][prop];
}
  else {
    return "No such contact";
  }
}
  else if (contacts[i].firstName != firstName){
    return "No such property";
  }
  }

// Only change code above this line
}

// Change these values to test your function
lookUpProfile("Akira", "likes");
Stephen James
@sjames1958gm
Jan 28 2017 00:30
@afrikhero your loop looks ok - your call to hasOwnProperty is missing the property - finally how can you return
no such contact before checking all contacts
Joseph Uchenna
@afrikhero
Jan 28 2017 00:32
@sjames1958gm thanks lemme add the prop. what I do in the case of return
CamperBot
@camperbot
Jan 28 2017 00:32
afrikhero sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 5565 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
itsthomas
@itsthomas
Jan 28 2017 00:34
What is the best way to concatinate all JavaScript files? Rquire.js? or Gulp? Or what else?
Stephen James
@sjames1958gm
Jan 28 2017 00:36
@itsthomas webpack seems to be the tool of choice these days
Joseph Uchenna
@afrikhero
Jan 28 2017 00:37
@sjames1958gm this what I have now

//Setup
var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intriguing Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    }
];


function lookUpProfile(firstName, prop){
// Only change code below this line
  var result = "";
  for(var i in contacts){

if (contacts[i].firstName === firstName){
  if(contacts[i].hasOwnProperty(prop)){
  return contacts[i][prop];
}
  else {
    result = "No such property";
  }
}
  else if (contacts[i].firstName != firstName){
    result = "No such contact";
  }
  }

// Only change code above this line
}

// Change these values to test your function
lookUpProfile("Akira", "likes");
itsthomas
@itsthomas
Jan 28 2017 00:37
@sjames1958gm Thanks. Never heard about web pack.
CamperBot
@camperbot
Jan 28 2017 00:37
itsthomas sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 5566 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
itsthomas
@itsthomas
Jan 28 2017 00:37
@sjames1958gm what about squire.js? Is it worth to learn it?
Stephen James
@sjames1958gm
Jan 28 2017 00:38
@itsthomas Have not heard of that one
itsthomas
@itsthomas
Jan 28 2017 00:38
@sjames1958gm sorry, I menat require.js !! :-)
Is it worth to learn it or should I learn web pack?
Stephen James
@sjames1958gm
Jan 28 2017 00:39
@itsthomas I think webpack or system.js are the two to learn
itsthomas
@itsthomas
Jan 28 2017 00:40
@sjames1958gm Thanks so much.
CamperBot
@camperbot
Jan 28 2017 00:40
itsthomas sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:warning: itsthomas already gave sjames1958gm points
Joseph Uchenna
@afrikhero
Jan 28 2017 00:43
@sjames1958gm please help me understand this

//Setup
var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intriguing Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    }
];


function lookUpProfile(firstName, prop){
// Only change code below this line
  var result = "";
  for(var i in contacts){

if (contacts[i].firstName === firstName){
  if(contacts[i].hasOwnProperty(prop)){
  return contacts[i][prop];
}
  else {
    result = "No such property";
    return result;
  }
}
  else if (contacts[i].firstName != firstName){
    result = "No such contact";

  }
  }

// Only change code above this line
}

// Change these values to test your function
lookUpProfile("Akira", "likes");
Ken Haduch
@khaduch
Jan 28 2017 00:45
@afrikhero - has anyone introduced you to the website http://pythontutor.com/javascript.html#mode=display ? It is a great site for pasting your code and stepping through it to visualize how it is working. A good learning tool.
it will help you sort out what is happening with the "No such contact" return, because you have that in the wrong place. There is actually no test that you can do within the for loop for determining "No such contact", at least not without jumping through some hoops. But try pythontutor...
Change your function call from this: lookUpProfile("Akira", "likes"); to this: lookUpProfile("Harry", "likes"); when you run it.
Dylan Hsiao
@greedylan
Jan 28 2017 00:49
for exercise "symmetric difference" the following code returns only the first argument. am i missing something here?
function sym(args) {  
  var symmetricD = function(accu, curr){

    for(var i=0; i<curr.length; i++){
      var index1 = accu.indexOf(curr[i]); 
      var index2 = curr.indexOf(curr[i]);

      if(index1 > -1){
        accu.splice(index1, 1);
        curr.splice(index2, 1);  
      }
    }

    return accu.concat(curr);

  };
  return args.reduce(symmetricD, []); 
}

sym([1, 2, 3,], [5, 2, 1, 4]);
Stefan Langenborg
@slangenborg
Jan 28 2017 00:56
can anyone help explain why my current code isn't working? it's meant to remove any values found in the additional arguments passed through

function destroyer(arr) {
function checker(val){
for (var i=1;i<arguments.length;i++){
if (val == arguments[i]){
return false;
}
}
return true;

}
// Remove all the values
return arr.filter(checker);
}

Joseph Uchenna
@afrikhero
Jan 28 2017 00:57
@khaduch thanks for the tool. Really cool. my challenge still returns "Bob", "number" should return "No such contact"
CamperBot
@camperbot
Jan 28 2017 00:57
afrikhero sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 2368 | @khaduch |http://www.freecodecamp.com/khaduch
porschedreams
@porschedreams
Jan 28 2017 01:04

Set remainder equal to the remainder of 11 divided by 3 using the remainder (%) operator.

Anyone can help me with this problem. Im not understaind remainders all that well.

Jamal Uddin
@jamal-pb95
Jan 28 2017 01:07
var myStr;
myStr = "I am a \"double quoted\" string inside \"double qoutes\".";
where is my problem, please anybody suggest me!
Moisés Man
@moigithub
Jan 28 2017 01:09
quotes... not qoutes @jamal-pb95
porschedreams
@porschedreams
Jan 28 2017 01:09
Need help, please
Jamal Uddin
@jamal-pb95
Jan 28 2017 01:10
@porschedreams that means 11/3 = 3*3 + 2, if you use % then get your result 2
Stephen Jones
@Jackdus
Jan 28 2017 01:10
I'm on "Using Objects for Lookups" and not sure what I'm doing wrong..

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

// Only change code below this line
var lookup ={
"alpha":"Adams",

"bravo":"Boston",

"charlie":"Chicago",

"delta":"Denver",

"echo":"Easy",

"foxtrot":"Frank",

"":undefined
};
// Only change code above this line
return result;
}

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

Jamal Uddin
@jamal-pb95
Jan 28 2017 01:13
@moigithub please let me show where I not use quotes.
Moisés Man
@moigithub
Jan 28 2017 01:13
typo error...
read again ur code @jamal-pb95
msg-coder
@msg-coder
Jan 28 2017 01:13
@sjames1958gm http://codepen.io/msgill/pen/xgLNPX why when i click search button it create two objects.i am using chrome
Bethany
@bcuenod
Jan 28 2017 01:15
Ok, I'm having difficulty with the profile lookup, or more specifically, the actual solution. My issue stems from the fact that while firstName is an actual object, hasOwnProperty is never even mentioned in the contacts array.
Bethany
@bcuenod
Jan 28 2017 01:21
Is it because prop is just known in JS ?
Ken Haduch
@khaduch
Jan 28 2017 01:24

@bcuenod - Hi Bethany - what you have is two different function arguments, and within the body of the function, you use those as variables (because they are variables) and they are set up with the values that are put in the function's parentheses when it is called.

Object.hasOwnProperty() is a method of Object - you can pass a property by name, as a string myObj.hasOwnProperty("firstName"); or in this case, since you are looking for a property that is passed in a variable, you can use myObj.hasOwnProperty( propVar ); (I am using example names, not necessarily the names from the exercise.)

@bcuenod - someone who helps on here a lot has a nice graphic that he posts (it is @revisualize, his user name) I saved the link to it, in case you are uncertain about function characteristics. https://cs.wellesley.edu/~cs110/lectures/L16/images/function-anatomy.png - and if I didn't get your question, ask again!
Diego Mayer
@Chrono79
Jan 28 2017 01:27
@slangenborg each function has its own arguments object
Stephen Jones
@Jackdus
Jan 28 2017 01:28

Not sure what I'm doing wrong, but this isn't returning anything .

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

// Only change code below this line
var lookup ={
"alpha":"Adams",

"bravo":"Boston",

"charlie":"Chicago",

"delta":"Denver",

"echo":"Easy",

"foxtrot":"Frank",

"":undefined
};
// Only change code above this line
return result;
}

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

Ken Haduch
@khaduch
Jan 28 2017 01:29
@bcuenod - oh, and you said "firstName is an actual object" - that's not exactly true. It is one of the function arguments firstName, which will contain the name (from the function call) that you are to look for. It is also a property of the contacts array objects - so it is an actual property, meaning you can refer to it in the object access context using .firstName - dot notation. The prop variable has to be used differently. (Refer to the previous lessons about access an object with variables)
Stephen Jones
@Jackdus
Jan 28 2017 01:29
the assignment is "using objects for lookups"
Elias Wiley
@thesadclown01
Jan 28 2017 01:30
@Jackdus try removing "":undefined
Stephen Jones
@Jackdus
Jan 28 2017 01:31
I did still didn't return
Diego Mayer
@Chrono79
Jan 28 2017 01:31
@Jackdus you have to change result value before returning it
Review this challenge: https://www.freecodecamp.com/challenges/accessing-objects-properties-with-variables
Alexander L
@niquepg
Jan 28 2017 01:32
@Jackdus it look like you are only return result which is an empty string
Stephen Jones
@Jackdus
Jan 28 2017 01:32
@Chrono79 thanks I got it now
CamperBot
@camperbot
Jan 28 2017 01:32
jackdus sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 3257 | @chrono79 |http://www.freecodecamp.com/chrono79
Joseph Uchenna
@afrikhero
Jan 28 2017 01:38
@Jackdus am stucked here.
```

//Setup
var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intriguing Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    }
];


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

if (contacts[i].firstName === firstName){
  if(contacts[i].hasOwnProperty(prop)){
  result = contacts[i][prop];
    return result;

}
  else {
    result = "No such property";
    return result;
  }

}
    else if (contacts[i].firstName != firstName){
      result = "No such contact";
    }

  }


// Only change code above this line
}

// Change these values to test your function
lookUpProfile("Akira", "likes");
Stephen James
@sjames1958gm
Jan 28 2017 01:39
@afrikhero You set result to no such contact - you should return that somewhere
Joseph Uchenna
@afrikhero
Jan 28 2017 01:40
@sjames1958gm when I add return to the last else if statement it reads error
Stephen James
@sjames1958gm
Jan 28 2017 01:40
@afrikhero Maybe another place to return that - what happens when you run out of contacts?
Joseph Uchenna
@afrikhero
Jan 28 2017 01:40
@sjames1958gm check it here pls https://www.freecodecamp.com/challenges/profile-lookup#?solution=%0A%2F%2FSetup%0Avar%20contacts%20%3D%20%5B%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22firstName%22%3A%20%22Akira%22%2C%0A%20%20%20%20%20%20%20%20%22lastName%22%3A%20%22Laine%22%2C%0A%20%20%20%20%20%20%20%20%22number%22%3A%20%220543236543%22%2C%0A%20%20%20%20%20%20%20%20%22likes%22%3A%20%5B%22Pizza%22%2C%20%22Coding%22%2C%20%22Brownie%20Points%22%5D%0A%20%20%20%20%7D%2C%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22firstName%22%3A%20%22Harry%22%2C%0A%20%20%20%20%20%20%20%20%22lastName%22%3A%20%22Potter%22%2C%0A%20%20%20%20%20%20%20%20%22number%22%3A%20%220994372684%22%2C%0A%20%20%20%20%20%20%20%20%22likes%22%3A%20%5B%22Hogwarts%22%2C%20%22Magic%22%2C%20%22Hagrid%22%5D%0A%20%20%20%20%7D%2C%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22firstName%22%3A%20%22Sherlock%22%2C%0A%20%20%20%20%20%20%20%20%22lastName%22%3A%20%22Holmes%22%2C%0A%20%20%20%20%20%20%20%20%22number%22%3A%20%220487345643%22%2C%0A%20%20%20%20%20%20%20%20%22likes%22%3A%20%5B%22Intriguing%20Cases%22%2C%20%22Violin%22%5D%0A%20%20%20%20%7D%2C%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22firstName%22%3A%20%22Kristian%22%2C%0A%20%20%20%20%20%20%20%20%22lastName%22%3A%20%22Vos%22%2C%0A%20%20%20%20%20%20%20%20%22number%22%3A%20%22unknown%22%2C%0A%20%20%20%20%20%20%20%20%22likes%22%3A%20%5B%22Javascript%22%2C%20%22Gaming%22%2C%20%22Foxes%22%5D%0A%20%20%20%20%7D%0A%5D%3B%0A%0A%0Afunction%20lookUpProfile(firstName%2C%20prop)%7B%0A%2F%2F%20Only%20change%20code%20below%20this%20line%0A%20%20var%20result%20%3D%20%22%22%3B%0A%20%20for(var%20i%20%3D%200%3B%20i%20%3C%20contacts.length%3B%20i%2B%2B)%7B%0A%20%20%20%20%20%20%20%0Aif%20(contacts%5Bi%5D.firstName%20%3D%3D%3D%20firstName)%7B%0A%20%20if(contacts%5Bi%5D.hasOwnProperty(prop))%7B%0A%20%20result%20%3D%20contacts%5Bi%5D%5Bprop%5D%3B%0A%20%20%20%20return%20result%3B%0A%20%20%20%20%0A%7D%0A%20%20else%20%7B%0A%20%20%20%20result%20%3D%20%22No%20such%20property%22%3B%0A%20%20%20%20return%20result%3B%0A%20%20%7D%0A%0A%7D%0A%20%20%20%20else%20if%20(contacts%5Bi%5D.firstName%20!%3D%20firstName)%7B%0A%20%20%20%20%20%20result%20%3D%20%22No%20such%20contact%22%3B%0A%20%20%20%20%7D%0A%0A%20%20%7D%0A%20%20%0A%20%20%0A%2F%2F%20Only%20change%20code%20above%20this%20line%0A%7D%0A%0A%2F%2F%20Change%20these%20values%20to%20test%20your%20function%0AlookUpProfile(%22Akira%22%2C%20%22likes%22)%3B%0A
grantknaver
@grantknaver
Jan 28 2017 01:41
how does this look to everyone

function checkCashRegister(price, cash, cid) {

 // Here is your change, ma'am.
  var moneyTypes = [

{name: "ONE HUNDRED", val: 100.00},
{name:"TWENTY", val: 20.00},
{name:"TEN", val: 10.00},
{name: "FIVE", val: 5.00},
{name:"ONE", val: 1.00},
{name: "QUARTER", val: 0.25},
{name: "DIME", val: 0.10}, 
{name: "NICKEL", val: 0.05},
{name:"PENNY", val: 0.01}

];
  var answer = [];
  var inverseCid = cid.reverse();
  var howManyDenominations = [];
  for(var i = 0; i < cid.length; i++){
    answer.push(cid[i][1]);
    //howManyDenominations.push(Math.round(inverseCid[i][1] / moneyTypes[i].val));
  }
  var cashInDrawer = answer.reduce(function(a,b){return a + b;});
  cashInDrawer = cashInDrawer.toFixed(2);
  var changeDo = cash - price;
  changeDo = changeDo.toFixed(2);
  var changeReturn = [];



  //var changeReturnReduced = changeReturn.reduced(function(a,b){return a + b;});
  //var sortedChange = changeDo.sort(function(a,b){return b[1] < a[1];});
  //var exampletest = example.reduce(function(a,b){return a + b;});
  //var kindOfMoney = inverseCid[a][0];
     if(cashInDrawer < changeDo){
      return "Insufficient Funds";
    }else if(cashInDrawer === changeDo){
      return "Closed";
    }else{
      var example = [];
      for(var a = 0; a < inverseCid.length; a++){
        var amount = inverseCid[a][1];
          if(inverseCid[a][1] !== 0){

            var amountOfChange = moneyTypes[a].val;
            while(amountOfChange < amount){
             amountOfChange = amountOfChange + moneyTypes[a].val;
            }//while loop
            changeReturn.push(inverseCid[a][0]+ "," + amountOfChange);

          }//if 
      }//for loop
    }//else 
  ///alert(inverseCid[0][0]+ "," + 2 * moneyTypes[0].val);
}



checkCashRegister(19.50, 20.00, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.10], ["QUARTER", 4.25], ["ONE", 90.00], ["FIVE", 55.00], ["TEN", 20.00], ["TWENTY", 60.00], ["ONE HUNDRED", 100.00]]);
not sure if I am happy with the amount of change while loop any ideas anyone
Joseph Uchenna
@afrikhero
Jan 28 2017 01:41
I can't use break and return the same time. Hope am right? @sjames1958gm
Stephen James
@sjames1958gm
Jan 28 2017 01:42
@afrikhero Just add return result after the for loop
@grantknaver Your changeReturn push looks wrong - you are pushing a string not an array
Adam M. Erickson
@ericksa
Jan 28 2017 01:43
@afrikhero I used your code and made these changes to make it work.
Bethany
@bcuenod
Jan 28 2017 01:44
Thank you @khaduch It's difficult to figure some of these things when there's only one exercise on each
CamperBot
@camperbot
Jan 28 2017 01:44
bcuenod sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 2369 | @khaduch |http://www.freecodecamp.com/khaduch
Adam M. Erickson
@ericksa
Jan 28 2017 01:44

@afrikhero function lookUpProfile(firstName, prop){
// Only change code below this line
var result = "";
for(var i in contacts){

if (contacts[i].firstName == firstName && contacts[i].hasOwnProperty(prop)){
result = contacts[i][prop];

} else if (result === "" && contacts[i].firstName !== firstName) {
result = "No such contact";
} else if (result === "" && !contacts[i].hasOwnProperty(prop)) {
result = "No such property";
}

}
return result;
}

Joseph Uchenna
@afrikhero
Jan 28 2017 01:44
sonic boom! what I have been waiting for over 5 hours of being stucked. Thanks a million times @sjames1958gm
CamperBot
@camperbot
Jan 28 2017 01:44
afrikhero sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 5567 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Ken Haduch
@khaduch
Jan 28 2017 01:45
@afrikhero - you have to move that business about "No such contact" outside of the for loop code block. And as others have said return "No such contact"; (at that point, you do not have to test anything.)
Joseph Uchenna
@afrikhero
Jan 28 2017 01:47
thanks @ericksa @khaduch you guys rock! I even learnt I don't need to use return repeatedly. the last return after the loop can do
CamperBot
@camperbot
Jan 28 2017 01:47
afrikhero sends brownie points to @ericksa and @khaduch :sparkles: :thumbsup: :sparkles:
:warning: afrikhero already gave khaduch points
:cookie: 217 | @ericksa |http://www.freecodecamp.com/ericksa
c0d0er
@c0d0er
Jan 28 2017 01:48
does anybody know why i click clear button, the state doesnt change? why the generation doesnt change to 0 even i set gen=0? http://codepen.io/c0d0er/pen/apLNPV?editors=0010
grantknaver
@grantknaver
Jan 28 2017 01:48
@sjames1958gm thanks how about now
CamperBot
@camperbot
Jan 28 2017 01:48
grantknaver sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 5568 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
grantknaver
@grantknaver
Jan 28 2017 01:48

function checkCashRegister(price, cash, cid) {

 // Here is your change, ma'am.
  var moneyTypes = [

{name: "ONE HUNDRED", val: 100.00},
{name:"TWENTY", val: 20.00},
{name:"TEN", val: 10.00},
{name: "FIVE", val: 5.00},
{name:"ONE", val: 1.00},
{name: "QUARTER", val: 0.25},
{name: "DIME", val: 0.10}, 
{name: "NICKEL", val: 0.05},
{name:"PENNY", val: 0.01}

];
  var answer = [];
  var inverseCid = cid.reverse();
  var howManyDenominations = [];
  for(var i = 0; i < cid.length; i++){
    answer.push(cid[i][1]);
    //howManyDenominations.push(Math.round(inverseCid[i][1] / moneyTypes[i].val));
  }
  var cashInDrawer = answer.reduce(function(a,b){return a + b;});
  cashInDrawer = cashInDrawer.toFixed(2);
  var changeDo = cash - price;
  changeDo = changeDo.toFixed(2);
  var changeReturn = [];



  //var changeReturnReduced = changeReturn.reduced(function(a,b){return a + b;});
  //var sortedChange = changeDo.sort(function(a,b){return b[1] < a[1];});
  //var exampletest = example.reduce(function(a,b){return a + b;});
  //var kindOfMoney = inverseCid[a][0];
     if(cashInDrawer < changeDo){
      return "Insufficient Funds";
    }else if(cashInDrawer === changeDo){
      return "Closed";
    }else{
      var example = [];
      for(var a = 0; a < inverseCid.length; a++){
        var amount = inverseCid[a][1];
          if(inverseCid[a][1] !== 0){

            var amountOfChange = moneyTypes[a].val;
            while(amountOfChange < amount){
             amountOfChange = amountOfChange + moneyTypes[a].val;
            }//while loop

            changeReturn += "[" + inverseCid[a][0]+ "," + amountOfChange + "]";

          }//if 
      }//for loop
    }//else 
  alert();
}



checkCashRegister(19.50, 20.00, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.10], ["QUARTER", 4.25], ["ONE", 90.00], ["FIVE", 55.00], ["TEN", 20.00], ["TWENTY", 60.00], ["ONE HUNDRED", 100.00]]);
Ken Haduch
@khaduch
Jan 28 2017 01:57
@ericksa - does the code that you posted here: :point_up: January 27, 2017 8:44 PM actually pass all of the tests? I think that it has an error in it, but it's a little confusing that is seems to pass the tests?
if I run it in python tutor, it doesn't run?
Brandon Achu
@bachu-dev
Jan 28 2017 01:59
This message was deleted
Ken Haduch
@khaduch
Jan 28 2017 02:11
@ericksa - it does run, but kind of a flukey reason for it. A little baffling? Or maybe I cut and pasted incorrectly into pythontutor - it does work. I still say it's kind of a flukey reason for it!
Adam M. Erickson
@ericksa
Jan 28 2017 02:14
@khaduch - First step, make it pass the tests. Second step, clean it up. :)
Ken Haduch
@khaduch
Jan 28 2017 02:15
@ericksa - I couldn't see why it is running, but after stepping through a couple times, the "result" variable saves the day! :)
Nicolas Figueroa
@nicolasfig
Jan 28 2017 02:20

Can anyone help me pleas

function lookUpProfile(firstName, prop){
// Only change code below this line
  for(var i = 0; i < contacts.length; i++){
    if(contacts[i].firstName == firstName && contacts[i].hasOwnProperty(prop)){
      return contacts[i][prop];
    }else if(contacts[i].firstName != firstName){
      return "No such contact";
    }else if(!contacts[i].hasOwnProperty(prop)){
      return "No such property";
    }
  }
// Only change code above this line
}

It works for the first cases if I remove the else if statements but when I add them it works for the last 2 cases, I don't know what I'm doing wrong.

Johnny
@JohnnyBizzel
Jan 28 2017 02:22
@NicolasFig You will return early from the loop in some cases
Adam M. Erickson
@ericksa
Jan 28 2017 02:25
@NicolasFig its because you are running through the entire loop, returning multiple results. There is more than one place where contacts[i].firstName != firstName.
Johnny
@JohnnyBizzel
Jan 28 2017 02:25
Quiet tonight :sleeping:
Adam M. Erickson
@ericksa
Jan 28 2017 02:25
@NicolasFig
'''
var result = "";
for(var i in contacts){
if (contacts[i].firstName == firstName && contacts[i].hasOwnProperty(prop)){
result = contacts[i][prop];
} else if (result === "" && contacts[i].firstName !== firstName) {
result = "No such contact";
} else if (result === "" && !contacts[i].hasOwnProperty(prop)) {
result = "No such property";
}
}
return result;
}
'''
CamperBot
@camperbot
Jan 28 2017 02:25
:bulb: to format code use backticks! ``` more info
Ken Haduch
@khaduch
Jan 28 2017 02:25
@ericksa - just to make a note of it, if there was a test case like this: lookUpProfile("Harry", "reads"); your code would return "No such contact" when it should return "No such property" - there just happens to not be a test case like that at the current time. :) Not trying to be picky, but there is just a fundamental problem with your code that happens to pass the current set of data and tests.
Nicolas Figueroa
@nicolasfig
Jan 28 2017 02:27
@ericksa @JohnnyBizzel thank you I'll check that
CamperBot
@camperbot
Jan 28 2017 02:27
nicolasfig sends brownie points to @ericksa and @johnnybizzel :sparkles: :thumbsup: :sparkles:
:cookie: 230 | @ericksa |http://www.freecodecamp.com/ericksa
:star2: 1193 | @johnnybizzel |http://www.freecodecamp.com/johnnybizzel
Johnny
@JohnnyBizzel
Jan 28 2017 02:28
@NicolasFig thanks
CamperBot
@camperbot
Jan 28 2017 02:28
johnnybizzel sends brownie points to @nicolasfig :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for nicolasfig
Adam M. Erickson
@ericksa
Jan 28 2017 02:35
@khaduch Good catch. Sometimes I'm just trying to past test instead of looking at the logid.
Randy Goldsmith
@Dueldrawer8
Jan 28 2017 02:35
my code will not return 0 if i have an empty array.. it says cannot read property length of undefined...
function getLengthOfShortestElement(arr) {
  // your code here
  var counter = arr[0].length;
  arr.forEach(function(x){

      if(x.length < counter){
          counter = x.length;
      }
  });
 return arr.length > 0 ? counter : 0;
}

 getLengthOfShortestElement(['one', 'two', 'an']);
Ken Haduch
@khaduch
Jan 28 2017 02:36
@Dueldrawer8 - you are trying to use arr[0].length if the array is empty - that will be undefined, so it will give you that error.
Randy Goldsmith
@Dueldrawer8
Jan 28 2017 02:37
@khaduch i cant move var counter inside the foreach loop
Ken Haduch
@khaduch
Jan 28 2017 02:37
if you just initialize counter to 0, will it pass?
Randy Goldsmith
@Dueldrawer8
Jan 28 2017 02:37
it cant read it
Ken Haduch
@khaduch
Jan 28 2017 02:38
if you just set var counter = 0; outside of the .forEach loop, then just return counter; at the end, will it work?
probably better to use .reduce() for this one anyway, I think? Or are you supposed to be using .forEach?
SkeptiDad
@SkeptiDad
Jan 28 2017 02:42
Hey everyone, I'm having trouble with the capitalize first letter exercise.
Ken Haduch
@khaduch
Jan 28 2017 02:42
@Dueldrawer8 - which challenge is this?
SkeptiDad
@SkeptiDad
Jan 28 2017 02:43
My function to capitalize the first letter works, but for some reason my for loop isn't calling it when I iterate through the array.
Alvin Rodis
@alrodis
Jan 28 2017 02:43
help please - I'm on the incrementing a number challenge and I can't get the, "myVar = myVar should be changed" test to pass...
CamperBot
@camperbot
Jan 28 2017 02:43
no wiki entry for: please - im on the incrementing a number challenge and i cant get the myvar myvar should be changed test to pass
Alvin Rodis
@alrodis
Jan 28 2017 02:43

var myVar = 87;

// Only change code below this line
myVar = ++myVar;

Ken Haduch
@khaduch
Jan 28 2017 02:44
@alrodis - incrementing should use the ++ operator - review the examples in the problem description to see how the proper use of ++ should be done.
SkeptiDad
@SkeptiDad
Jan 28 2017 02:44
try myVar += myVar
Ken Haduch
@khaduch
Jan 28 2017 02:44
@SkeptiDad - what does your code look like for the capitalize problem?
Anmar0293
@Anmar0293
Jan 28 2017 02:45
Hi everyone. I'm stuck here since two hours ago. Could anyone show me the code so I could analyz it and understand?
Ken Haduch
@khaduch
Jan 28 2017 02:46
@Anmar0293 - what have you coded on this on so far?
Anmar0293
@Anmar0293
Jan 28 2017 02:46
I tried the switch case but it didnt' work!
@khaduch
Ken Haduch
@khaduch
Jan 28 2017 02:47
@Anmar0293 - okay, what did you try? Maybe some simple tweaks would fix it?
Anmar0293
@Anmar0293
Jan 28 2017 02:48
I restarted the computer. Could you at least help me if the switch case work?
just give me the hint what I should use and I will work it out. thanks in advance! @khaduch
CamperBot
@camperbot
Jan 28 2017 02:48
anmar0293 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 2370 | @khaduch |http://www.freecodecamp.com/khaduch
Randy Goldsmith
@Dueldrawer8
Jan 28 2017 02:49
@khaduch sorry was in bathroom ill try it and its not a challenge here at freecodecamp
Sean DiSanti
@badc0ded
Jan 28 2017 02:49
yes switch should work but there are always multiple ways to solve any problem
Ken Haduch
@khaduch
Jan 28 2017 02:49
@Dueldrawer8 - okay... see what happens
Anmar0293
@Anmar0293
Jan 28 2017 02:50
@badc0ded thanks! I will try
CamperBot
@camperbot
Jan 28 2017 02:50
anmar0293 sends brownie points to @badc0ded :sparkles: :thumbsup: :sparkles:
:cookie: 435 | @badc0ded |http://www.freecodecamp.com/badc0ded
Anmar0293
@Anmar0293
Jan 28 2017 02:52
I really don't know what to do with this!
please help! @khaduch
Randy Goldsmith
@Dueldrawer8
Jan 28 2017 02:52
@khaduch it will not work..
Sean DiSanti
@badc0ded
Jan 28 2017 02:52
show your code
help format
CamperBot
@camperbot
Jan 28 2017 02:53
no wiki entry for: format
Sean DiSanti
@badc0ded
Jan 28 2017 02:53
it's been a while, i forget the command to show code formatting instructions
Randy Goldsmith
@Dueldrawer8
Jan 28 2017 02:53
@khaduch returns undefined if i have anything passed into as arguements
Anmar0293
@Anmar0293
Jan 28 2017 02:53
I GOT IT!!! THANKS A LOT @badc0ded
CamperBot
@camperbot
Jan 28 2017 02:53
anmar0293 sends brownie points to @badc0ded :sparkles: :thumbsup: :sparkles:
:warning: anmar0293 already gave badc0ded points
Sean DiSanti
@badc0ded
Jan 28 2017 02:53
awesome, good job
Ken Haduch
@khaduch
Jan 28 2017 02:55
@Dueldrawer8 - can you post your updated code, please?
Anmar0293
@Anmar0293
Jan 28 2017 02:55
WAIT actually I didn't!
i reach to here!
k97513
@k97513
Jan 28 2017 02:55
How do I post code
Ken Haduch
@khaduch
Jan 28 2017 02:56
@k97513 - look at the following link from camperbot '''
CamperBot
@camperbot
Jan 28 2017 02:56
:bulb: to format code use backticks! ``` more info
Anmar0293
@Anmar0293
Jan 28 2017 02:56
@k97513 just copy it and past it
or copy your URL from the top browser
k97513
@k97513
Jan 28 2017 02:56
var count = 0;
var vp=[2,3,4,5,6];
var vz=[7,8,9];
var vn=[10,'J','Q','K','A'];
function cc(card) {
  if (vn.includes(card)) {
    count -= 1;
  }
  else if (vp.includes(card)) {
    count += 1;
  }
  return (count <= 0) ? count + " Hold" : count + " Bet";
k97513
@k97513
Jan 28 2017 02:56
Ah.
Randy Goldsmith
@Dueldrawer8
Jan 28 2017 02:56
@khaduch
function getLengthOfShortestElement(arr) {
  // your code here
  var counter = 0;
  arr.forEach(function(x){
      if(x.length < counter){
          counter = x.length;
      }
      return counter;
  });
}

 getLengthOfShortestElement(['one', 'on', 'three', 'guys']);
k97513
@k97513
Jan 28 2017 02:57
@Anmar0293 look at my code
That's what I did for that problem
Ken Haduch
@khaduch
Jan 28 2017 02:57
@Anmar0293 - you are not returning the values as the problem statement directs you - either with count + " Hold"; or count + " Bet";
@Dueldrawer8 - don't return counter; within your .forEach callback function - put it after the }); and try that...
Anmar0293
@Anmar0293
Jan 28 2017 02:58
@k97513 got it thanks but can you explain the return statement
CamperBot
@camperbot
Jan 28 2017 02:58
anmar0293 sends brownie points to @k97513 :sparkles: :thumbsup: :sparkles:
:cookie: 17 | @k97513 |http://www.freecodecamp.com/k97513
Anmar0293
@Anmar0293
Jan 28 2017 02:59
exactly, the return statement i don't get. I see it now but i would like to understand it. @khaduch
k97513
@k97513
Jan 28 2017 02:59
So the return basically says "If the count is less than or equal to 0, then return "count + Hold", otherwise return "count + Bet"
Anmar0293
@Anmar0293
Jan 28 2017 02:59
@k97513 wonderful thanks a lot
CamperBot
@camperbot
Jan 28 2017 02:59
anmar0293 sends brownie points to @k97513 :sparkles: :thumbsup: :sparkles:
:warning: anmar0293 already gave k97513 points
k97513
@k97513
Jan 28 2017 03:00
No problem
Randy Goldsmith
@Dueldrawer8
Jan 28 2017 03:00
@khaduch just returns 0
Ken Haduch
@khaduch
Jan 28 2017 03:00
@Anmar0293 - it is described in the text - The function will then return a string with the current count and the string ... you have to test the value of count for positive or negative value and return the appropriate result.
Randy Goldsmith
@Dueldrawer8
Jan 28 2017 03:00
@khaduch maybe easier with for loop?
Anmar0293
@Anmar0293
Jan 28 2017 03:01
thanks @khaduch
CamperBot
@camperbot
Jan 28 2017 03:01
:warning: anmar0293 already gave khaduch points
anmar0293 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
Ken Haduch
@khaduch
Jan 28 2017 03:01
@Dueldrawer8 - let me check - maybe I'm just missing something... I'm only running on half power today...
Randy Goldsmith
@Dueldrawer8
Jan 28 2017 03:01
@khaduch lol its ok..at least your helping
Ken Haduch
@khaduch
Jan 28 2017 03:02
@Dueldrawer8 - the problem is that you are testing if ( x.length < counter ) and counter is initialized to zero... I did miss that - you'll never change it if you have any strings of any length in the array...
Randy Goldsmith
@Dueldrawer8
Jan 28 2017 03:03
@khaduch yeah
Ken Haduch
@khaduch
Jan 28 2017 03:04
If you have strings in the array, you could initialize to arr[0].length, which is probably what you were doing before, but then you have to watch out for the case where you have nothing in the array.
Randy Goldsmith
@Dueldrawer8
Jan 28 2017 03:04
@khaduch excatly which was my initial question :)
Alvin Rodis
@alrodis
Jan 28 2017 03:04
@khaduch @SkeptiDad - thanks...got it now
CamperBot
@camperbot
Jan 28 2017 03:04
alrodis sends brownie points to @khaduch and @skeptidad :sparkles: :thumbsup: :sparkles:
:cookie: 243 | @skeptidad |http://www.freecodecamp.com/skeptidad
:star2: 2371 | @khaduch |http://www.freecodecamp.com/khaduch
Ken Haduch
@khaduch
Jan 28 2017 03:07
@Dueldrawer8 - so, what is it supposed to return if the array is empty (and you probably told me before, too...)
Randy Goldsmith
@Dueldrawer8
Jan 28 2017 03:07
@khaduch it should return 0
Ken Haduch
@khaduch
Jan 28 2017 03:08
@Dueldrawer8 - how about if you then do this at the top: if ( arr.length === 0 ) return 0; And then initialize counter = arr[0] if you don't return?
Anmar0293
@Anmar0293
Jan 28 2017 03:08
could anyone help
got it!
thanks all
Ken Haduch
@khaduch
Jan 28 2017 03:11
@Anmar0293 - good!
Randy Goldsmith
@Dueldrawer8
Jan 28 2017 03:12
@khaduch thank you, that did work
CamperBot
@camperbot
Jan 28 2017 03:12
dueldrawer8 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 2372 | @khaduch |http://www.freecodecamp.com/khaduch
Sasha
@SashaKoro
Jan 28 2017 03:20
@Anmar0293 Try setting them to the property, not the value
Adrian Warholm
@adrianwarholm
Jan 28 2017 03:27
Anybody online?
Sean DiSanti
@badc0ded
Jan 28 2017 03:27
rather than linking to the solution, just paste your code in between triple backticks
Anmar0293
@Anmar0293
Jan 28 2017 03:29
@badc0ded idid now
jpchaufan
@jpchaufan
Jan 28 2017 03:29
anybody here good with react?
Anmar0293
@Anmar0293
Jan 28 2017 03:30
@jpchaufan past your code
paste*
jpchaufan
@jpchaufan
Jan 28 2017 03:31
well its more of a conceptual question but my code is here
the thing that is acting strange is,
i am updating the state in my main component and it seems to update as i expect. like when i click to delete a recipe, it deletes properly from the state
but the rendered html that shows, it does not mach the state
it deletes a different one
DigitalTheorist
@DigitalTheorist
Jan 28 2017 03:32
Help on challenge "Using Objects for Lookups” please. I have returned the required output and cleared the challenge but have an error “result is already defined"
CamperBot
@camperbot
Jan 28 2017 03:32
no wiki entry for: on challenge using objects for lookups please i have returned the required output and cleared the challenge but have an error result is already defined
aslan527
@aslanzala
Jan 28 2017 03:32

in symmetric difference,my solution as follows:

function sym(args) {
  var arr = Array.prototype.slice.call(arguments);//将参数转化为数组
  //比较两个数组的差异
  function diffArray(arr1,arr2){
    var newArr = [];
    arr1.map(function(val){
      if(arr2.indexOf(val)<0){
        newArr.push(val);
      }
    });
    arr2.map(function(val){
      if(arr1.indexOf(val)<0){
        newArr.push(val);
      }
    });
    return newArr;
  }

  var result = arr.reduce(diffArray());
  return result;
}

sym([1, 2, 3], [5, 2, 1, 4]);

the console return > can't read property 'map' of undefined
does anyone check for me? Thanks

DigitalTheorist
@DigitalTheorist
Jan 28 2017 03:32
Mycode

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

// Only change code below this line
var lookup = {
"alpha": "Adams",

"bravo": "Boston",

"charlie": "Chicago",

"delta": "Denver",

"echo": "Easy",

"foxtrot": "Frank",

};

var result = lookup[val]; // references object "lookup" & applies function "val" to retrieve data.

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

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

Adrian Warholm
@adrianwarholm
Jan 28 2017 03:42
@DigitalTheorist Are you online currently? I'm here to help.
DigitalTheorist
@DigitalTheorist
Jan 28 2017 03:42
yep I’m here
Adrian Warholm
@adrianwarholm
Jan 28 2017 03:43
Nice to meet you. Your error is that "result is already defined".
DigitalTheorist
@DigitalTheorist
Jan 28 2017 03:43
yes
Adrian Warholm
@adrianwarholm
Jan 28 2017 03:43
This error occurred because you are trying to create a new instance of result. Let me show you where the error is.
var result = ""; and later on var result=lookup[val];
As you can see, you are trying to state set result to a different value when it's already created within its scope.
DigitalTheorist
@DigitalTheorist
Jan 28 2017 03:44
hrmm…so should I delet the initial var defined as result?
Adrian Warholm
@adrianwarholm
Jan 28 2017 03:45
Or you can simply just state result = lookup[val];
Both methods work.
jpchaufan
@jpchaufan
Jan 28 2017 03:45
hey could somebody help me understand something about react?
DigitalTheorist
@DigitalTheorist
Jan 28 2017 03:46
cool thanks @adrianwarholm
CamperBot
@camperbot
Jan 28 2017 03:46
digitaltheorist sends brownie points to @adrianwarholm :sparkles: :thumbsup: :sparkles:
:cookie: 2 | @adrianwarholm |http://www.freecodecamp.com/adrianwarholm
Adrian Warholm
@adrianwarholm
Jan 28 2017 03:46
No problem. @jpchaufan Sorry. I don't really know much about React other than the fact it's used with the MERN stack. But I can lead you to people who do know.
Have you tried HelpFrontEnd?
jpchaufan
@jpchaufan
Jan 28 2017 03:47
no i havebnt
i guess ill hop on over there
Adrian Warholm
@adrianwarholm
Jan 28 2017 03:48
You're correct to hop here since React is a Javascript library but others may answer you there since nobody is currently on who is experienced with it.
Good luck. :)
jpchaufan
@jpchaufan
Jan 28 2017 03:49
thanks!
Adam
@adamakers
Jan 28 2017 03:49
hows everyone doing tonight?
Adrian Warholm
@adrianwarholm
Jan 28 2017 03:49
Pretty stressful. @adamakers How about you?
Adam
@adamakers
Jan 28 2017 03:50
just working on my simon game. Getting close to finishing it
whats stressful?
jpchaufan
@jpchaufan
Jan 28 2017 03:50
Adrian youre helping out everybody, what is so stressful?
Adrian Warholm
@adrianwarholm
Jan 28 2017 03:51
Haha. It's just that I'm new to the MERN stack and I really don't know where to start off.
jpchaufan
@jpchaufan
Jan 28 2017 03:51
mongo express react node?
Adam
@adamakers
Jan 28 2017 03:51
I gotta learn that
Adrian Warholm
@adrianwarholm
Jan 28 2017 03:51
Yes.
jpchaufan
@jpchaufan
Jan 28 2017 03:51
are you following the fcc map?
Adam
@adamakers
Jan 28 2017 03:51
i dont know any of those haha
Adrian Warholm
@adrianwarholm
Jan 28 2017 03:52
So far, I am.
Actually, my MERN issues are the reason why I started FCC.
jpchaufan
@jpchaufan
Jan 28 2017 03:52
ah. do you already work as a developer with other stuff?
Adrian Warholm
@adrianwarholm
Jan 28 2017 03:52
Technically, yes and no.
I'm 16 so I'm not an actual developer.
Adam
@adamakers
Jan 28 2017 03:53
well damn...
jpchaufan
@jpchaufan
Jan 28 2017 03:53
but you get paid to develop programs? then id say youre a developer
and btw you arent supposed to be stressed out until youre at least 45
Adam
@adamakers
Jan 28 2017 03:53
yea thats pretty good that you know as much as you do
Adrian Warholm
@adrianwarholm
Jan 28 2017 03:54
Haha. Thanks guys. :)
jamesjd54
@jamesjd54
Jan 28 2017 03:55
hey guys im trying to do the algorithm scripting but the resources they link you to in mozilla are honestly just confusing me more and not helping at all
Adam
@adamakers
Jan 28 2017 03:55
hey @adrianwarholm, can you take a quick peek at this and tell me if this closure is the best way to stop this script? I’ve read about throw but not sure if that would be appropriate.
John P Penaloza
@johnpyp
Jan 28 2017 03:55

Hey guys, I'm currently working on the Javascript Algorithm Problem "Smallest Common Multiple". One of my problems is for some reason, something in my code seems to make FreeCodeCamp crash. I don't have an infinite loop that it is telling me about, and I don't have //noprotect on. Note: I had a similar problem with the Fibonachi sequence problem til I decided to skip it. Here is my very inefficent code so far:


function smallestCommons(arr) {
  //Numbers in Between

  var countArr = [];
  for (i = arr[0]; i <= arr[1]; i++) {
    countArr.push(i);
  }
  //Copying
  var a = [];
  for (i = 0; i < countArr.length; i++) {
    a.push(countArr[i]);
  }
  //Check number; Ez LCM
  var check = a.reduce(function(a, b) {
    return a * b;
  });
  var newArr = [];
  //Creating the multiples
  for (i = 0; i < a.length; i++) {
    newArr.push([]);
    for (j = 0; a[i] * j <= check; j++) {
      newArr[i].push(a[i] * j);
    }
  }

  return newArr;
}


smallestCommons([1,5]);

The goal of this code at the moment is to return an array with arrays inside of it that contain numbers counting their multiples up to a number that I know is a common multiple. For some reason, it says //testing challenge or whatever but then the website crashes. I have to run the website again with run=disabled to fix the code.

Someone please help!

Adam
@adamakers
Jan 28 2017 03:55
basically a closure that pauses the script
jamesjd54
@jamesjd54
Jan 28 2017 03:55
im doing check for palindromes and I know I need to use .replace() somehow but i just cant make any sense of their description
Adam
@adamakers
Jan 28 2017 03:55
@jamesjd54 hey james, what are you stuck on?
jamesjd54
@jamesjd54
Jan 28 2017 03:56
can someone tell me what part of the article i should be reading?
this challenge

and this is my code so far

function palindrome(str) {
var reversed=str.split(" ").reverse().join(" ");
var result=reversed.replace();

if (result==str){
return true;
}else{
return false;
}

}

palindrome("eye");

bradulz
@bradulz
Jan 28 2017 03:57
can someone help me on a project of mine?
Adam
@adamakers
Jan 28 2017 03:58
@jamesjd54 take a look at your if statement
@jamesjd54 wait
bradulz
@bradulz
Jan 28 2017 03:58
I fill an array and later on when I check the arrays contents, they are different for no reason :/
Adrian Warholm
@adrianwarholm
Jan 28 2017 03:58
@adamakers It works fine for me. Throw is just for exceptions/errors. I wouldn't use it for any other functionality conventionally.
John P Penaloza
@johnpyp
Jan 28 2017 03:58
@jamesjd54 The way that I used replace was to filter out non-alphanumeric characters. This is what I did to accomplish that: str = str.replace(/[^0-9a-z]/gi, '');
Adam
@adamakers
Jan 28 2017 03:59
^^
regex is a pain
jamesjd54
@jamesjd54
Jan 28 2017 03:59
ohhh right ya i know the if statement wont match, that was supposed to be the reversed, but i replaced it with result which was supposed to be a var that eliminated everything non-alphanumeric. i just cant figure out how to use replace to do that
yes, regex is just messing with my head so much. from reading the resource on mozilla it seemed like i had to use regex but i just dont even get where to start with that
Adam
@adamakers
Jan 28 2017 03:59
@adrianwarholm thanks. Yea I didnt think throw would be appropriate.
CamperBot
@camperbot
Jan 28 2017 03:59
adamakers sends brownie points to @adrianwarholm :sparkles: :thumbsup: :sparkles:
:cookie: 3 | @adrianwarholm |http://www.freecodecamp.com/adrianwarholm
Adam
@adamakers
Jan 28 2017 04:00
@jamesjd54 I’ll put together a set of links for you for regex help and tuts
John P Penaloza
@johnpyp
Jan 28 2017 04:00
@jamesjd54 Well, there it is. That regex shit is really stupid to deal with as a newcomer. Once you get the basics, basics are easy. The regex I have essentially says: "if not 0-9 or a-z, filter it out.
\
jamesjd54
@jamesjd54
Jan 28 2017 04:01
ok and so assuming i just set result to reversed.replace(/[^0-9a-z]/gi, ''); then my code would work
xemexpress
@xemexpress
Jan 28 2017 04:01
I took this as reference
jamesjd54
@jamesjd54
Jan 28 2017 04:01
and so what does the gi mean?
jpchaufan
@jpchaufan
Jan 28 2017 04:02
global and case insensitive
John P Penaloza
@johnpyp
Jan 28 2017 04:02
the g means all instances in that string. The i means case insensitive
g also means global, ya.
jamesjd54
@jamesjd54
Jan 28 2017 04:02
@adamakers thanks man. i was way too overwhelmed just following links on mozilla. each one was just confusing me more than the last. ill give those a read.
CamperBot
@camperbot
Jan 28 2017 04:02
jamesjd54 sends brownie points to @adamakers :sparkles: :thumbsup: :sparkles:
:cookie: 320 | @adamakers |http://www.freecodecamp.com/adamakers
jamesjd54
@jamesjd54
Jan 28 2017 04:03
sweet thanks guys
jpchaufan
@jpchaufan
Jan 28 2017 04:03
hey is anyone in here able to help me with a react question?
Adam
@adamakers
Jan 28 2017 04:03
@jamesjd54 I really like that last one. It’s not as deep as some others, but I think its a good starting point
jamesjd54
@jamesjd54
Jan 28 2017 04:04
i think starting high level would be best for me right now. had a few beers at dinner so i think im just not that sharp at the moment
Christopher McCormack
@cmccormack
Jan 28 2017 04:06
Anyone familiar enough with bootstrap able to tell my why my navbar isn't showing the collapse when in a narrow viewport? http://codepen.io/cmccormack/pen/BpwqpG
Gulsvi
@gulsvi
Jan 28 2017 04:08
@cmccormack I think bootstrap's javascript needs jQuery, so it has to be above bootstrap in your codepen settings
fffear
@fffear
Jan 28 2017 04:09
this is my code var myStr = "FirstLine\n\SecondLine\\rThirdline"; // Change this line
Christopher McCormack
@cmccormack
Jan 28 2017 04:09
@SkyCoder01 Thanks! I didn't even think of the order...
CamperBot
@camperbot
Jan 28 2017 04:09
cmccormack sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:cookie: 63 | @skycoder01 |http://www.freecodecamp.com/skycoder01
bradulz
@bradulz
Jan 28 2017 04:10
heres my html, js and css of my code im stuck on. It somehow changes the values of the arrays, which you can see in the console log
Adrian Warholm
@adrianwarholm
Jan 28 2017 04:10
@fffear You forgot another backslash.
\Second\
\\Second Line\\
^
Then, you'd add a \r afterwards.
This will encapsulate SecondLine with two backslashes and send ThirdLine to the next line.
Christopher McCormack
@cmccormack
Jan 28 2017 04:11
@SkyCoder01 Would this also be true if adding the libraries via the <head> element? Is this an issue of priority?
And by priority I guess I mean maybe functions with the same name in both libraries or something like that
Gulsvi
@gulsvi
Jan 28 2017 04:12
@cmccormack I'm not sure :/ I was just playing with navbars yesterday and the same problem happened to me
fffear
@fffear
Jan 28 2017 04:13
@adrianwarholm var myStr = "FirstLine\n\SecondLine\\rThirdline" Made the changes, but it still says "myStr should have encoded text with the proper escape sequences and no spacing."
Gulsvi
@gulsvi
Jan 28 2017 04:13
I think codepen just adds those to the <head> though, so I'm guessing yes
Anh Nguyen
@tiremon112
Jan 28 2017 04:13
\SecondLine\
\
Adrian Warholm
@adrianwarholm
Jan 28 2017 04:13
@fffear var myStr = "FirstLine\n\SecondLine\\rThirdLine"
Oops, let me fix that real quick
Coy Sanders
@coymeetsworld
Jan 28 2017 04:13
@SkyCoder01 @cmccormack if you click settings you'll see thats where the head section is, so if you need to import google fonts or something else you should do it from there
Adrian Warholm
@adrianwarholm
Jan 28 2017 04:14
@fffear var myStr = "FirstLine\b\\SecondLine\\rThirdLine"
Gulsvi
@gulsvi
Jan 28 2017 04:14
or, wait a minute... shouldn't scripts go at the end of the html?
Adrian Warholm
@adrianwarholm
Jan 28 2017 04:14
@SkyCoder01 Yes, at the end of the body
Coy Sanders
@coymeetsworld
Jan 28 2017 04:14
html/head/body tags are taken care of in the HTML sections. The document.ready(function() call is taken care for you in JS
Adrian Warholm
@adrianwarholm
Jan 28 2017 04:14
This helps loadtimes.
@fffear Sorry again. That's wrong. Gitter takes in overrides text
Christopher McCormack
@cmccormack
Jan 28 2017 04:15
@coymeetsworld I'm moving away from doing that because I'm going to host them on my own server. <head> works in the html section as well, it seems. Easier to copy and paste that way.
Coy Sanders
@coymeetsworld
Jan 28 2017 04:15
hmm ok, well its just to make it look cleaner @cmccormack
less indented code
if you know how to host your projects i probably wouldn't bother with codepen then
unless you have a compelling reason to use it I suppose
thinking about removing mine and putting them on github
Adrian Warholm
@adrianwarholm
Jan 28 2017 04:16
var myStr = "FirstLine\\SecondLine\\ \rThirdLine"
Gulsvi
@gulsvi
Jan 28 2017 04:16
Thanks @coymeetsworld and @adrianwarholm
@cmccormack Looks like codepen adds them in the same order toward the end of the <body> tag
CamperBot
@camperbot
Jan 28 2017 04:16
skycoder01 sends brownie points to @coymeetsworld and @adrianwarholm and @cmccormack :sparkles: :thumbsup: :sparkles:
:cookie: 4 | @adrianwarholm |http://www.freecodecamp.com/adrianwarholm
:cookie: 290 | @cmccormack |http://www.freecodecamp.com/cmccormack
:star2: 1961 | @coymeetsworld |http://www.freecodecamp.com/coymeetsworld
Christopher McCormack
@cmccormack
Jan 28 2017 04:16
eh FCC asks for the codepen and if I'm going to share I figured codepen might be more helpful to people here
Adrian Warholm
@adrianwarholm
Jan 28 2017 04:17
There we go. And don't forget the \n.
That should make it work.
fffear
@fffear
Jan 28 2017 04:17
@adrianwarholm It works now. Thanks for the help
CamperBot
@camperbot
Jan 28 2017 04:17
fffear sends brownie points to @adrianwarholm :sparkles: :thumbsup: :sparkles:
:cookie: 5 | @adrianwarholm |http://www.freecodecamp.com/adrianwarholm
Coy Sanders
@coymeetsworld
Jan 28 2017 04:17
@cmccormack I don't believe it HAS to be a codepen though
thats just what the majority of people will use since they may not have actual editors or have a place to host projects
codepen has both and its easy to use
Adrian Warholm
@adrianwarholm
Jan 28 2017 04:18
@coymeetsworld I thought it was required for the certificate though?
Coy Sanders
@coymeetsworld
Jan 28 2017 04:18
you need to have a working demo of the projects available online @adrianwarholm and the source code
but I don't think it has to be a codepen
maybe I'm wrong, have to check now :)
seems odd to make that a requirement
jamesjd54
@jamesjd54
Jan 28 2017 04:19
so why wouldnt this work?

function palindrome(str) {
var reversed=str.split("").reverse().join("");
var result=reversed.replace(/[^0-9a-z]/gi,'');

if (result==str){
return true;
}else{
return false;
}
}

palindrome("eye");

Adrian Warholm
@adrianwarholm
Jan 28 2017 04:19
@coymeetsworld Thanks. I believe you're correct.
CamperBot
@camperbot
Jan 28 2017 04:19
adrianwarholm sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star2: 1962 | @coymeetsworld |http://www.freecodecamp.com/coymeetsworld
Christopher McCormack
@cmccormack
Jan 28 2017 04:19
I did wonder what FCC does with those project pages when you submit... does someone actually review prior to a cert?
Coy Sanders
@coymeetsworld
Jan 28 2017 04:19
hmm instructions do reference codepen a few times
Adrian Warholm
@adrianwarholm
Jan 28 2017 04:19
@cmccormack I would believe so.
Coy Sanders
@coymeetsworld
Jan 28 2017 04:19
@cmccormack I don't think so,
when you apply for cert you get it automatically
bradulz
@bradulz
Jan 28 2017 04:20
    var six = Array(9).fill(Array(9).fill(""));


function solve(){

    var xcoord = 0;
    var ycoord = 0;
    var realCoordSet;
    var realx;
    var realy;

    $(".main").find('input').each(function(){
        //console.log(xcoord, ycoord, "old");
        realCoordSet = coordConversion(xcoord, ycoord);
        realx = realCoordSet[0];
        realy = realCoordSet[1];
       // console.log(realx, realy, "new");
        if($(this).val() !=""){

            if($(this).val() == "6"){
                console.log(realx, realy, "is");
                six[realx][realy] = "is";
            }
        }
        ycoord++;
        if(ycoord>8)
        {
            xcoord++;
            ycoord=0;
        }
        if(xcoord>8)
        {
            console.log("end");
            return null;
        }

    });

    for(var i6 = 0;i6<six.length;i6++) 
    {
        for(var j6 = 0;j6<six[i6].length;j6++)//for every element
        {
            console.log(six[i6][j6]);                


        }
    } //probabilities correct

};
the console log only shows 5 "is" being but in the 2d array but looping over to display the contents proves theres alot more. ive spent hours but cant find a reasonable answer
Coy Sanders
@coymeetsworld
Jan 28 2017 04:20
at least thats what happened to me for FE, and i didn't get any notification saying my tests were reviewed. In beta they're working on creating tests that validate your projects though
Also I've seen people get FE certs and have projects that didn't work
Christopher McCormack
@cmccormack
Jan 28 2017 04:21
Hmm I guess in the end your own skill is what will matter. No good submitting broken projects if you don't learn.
Coy Sanders
@coymeetsworld
Jan 28 2017 04:21
@cmccormack exactly, seen some people copy projects verbatim too, or challenges.
You get what you put into it
just like other types of certs you can cram or find ways to pass the tests without learning but you're just wasting time
Christopher McCormack
@cmccormack
Jan 28 2017 04:23
@coymeetsworld couldn't agree more. It's fun interviewing new engineers that have certs but can't explain core concepts critical to understanding the work they would be doing
Coy Sanders
@coymeetsworld
Jan 28 2017 04:23
even better when they have degrees :p @cmccormack
Coy Sanders
@coymeetsworld
Jan 28 2017 04:25
heh those have some good thoughts @cmccormack
Christopher McCormack
@cmccormack
Jan 28 2017 04:25
I'm out, thanks for the help
Coy Sanders
@coymeetsworld
Jan 28 2017 04:25
late :wave:
jamesjd54
@jamesjd54
Jan 28 2017 04:31
would .replace(/[^0-9a-z]/gi, ""); eliminate all non alphanumeric characters on a string with nothing?
Coy Sanders
@coymeetsworld
Jan 28 2017 04:33
regex missing something @jamesjd54
jpchaufan
@jpchaufan
Jan 28 2017 04:36
@jamesjd54 i dont think so
@jamesjd54 if i rememver, ^ means only at the start of a string
Coy Sanders
@coymeetsworld
Jan 28 2017 04:37
regex is case-insensitive
jamesjd54
@jamesjd54
Jan 28 2017 04:37
would using /W be a better way to do it?
jpchaufan
@jpchaufan
Jan 28 2017 04:38
oh nvm i was thinking something else ignore what i said
Coy Sanders
@coymeetsworld
Jan 28 2017 04:38
oh wait you have the i flag, nvm
jamesjd54
@jamesjd54
Jan 28 2017 04:38
its not passing me and i cant figure out whats wrong with it
Coy Sanders
@coymeetsworld
Jan 28 2017 04:38
yes that should be fine, no \W also filters underscore
can you post all your code?
bradulz
@bradulz
Jan 28 2017 04:38
    var six = Array(9).fill(Array(9).fill(""));


function solve(){

    var xcoord = 0;
    var ycoord = 0;
    var realCoordSet;
    var realx;
    var realy;

    $(".main").find('input').each(function(){
        six[1][0] = "is";

    });
ok this really simplifies my problem. Im only adding "is" to [1][0] but it also adds it to [2][0], [3][0]... Very weird
jamesjd54
@jamesjd54
Jan 28 2017 04:39

function palindrome(str) {
var reversed=str.split("").reverse().join("");
var result=reversed.replace(/[^0-9a-z]/gi,"");

if (result==str){
return true;
}else{
return false;
}
}

Coy Sanders
@coymeetsworld
Jan 28 2017 04:39
you're only filtering one string, not both
you need to strip the non-alphanumeric characters first, then get the reverse and compare
jamesjd54
@jamesjd54
Jan 28 2017 04:40
ok so just change the order?
Coy Sanders
@coymeetsworld
Jan 28 2017 04:41
think about it
what if str was _eye?
it should return true, but with your code it will not. Why? Regex is fine
actually wait I was wrong about the i flag on regex
look at note on challenge : "You'll need to remove all non-alphanumeric characters (punctuation, spaces and symbols) and turn everything lower case in order to check for palindromes."
you want to convert everything down to lowercase, so that "RaceCar" will still be a palindrome
jamesjd54
@jamesjd54
Jan 28 2017 04:47
yeah i just tested my function and it looks like at the very least i need to get the lowercase and ill see where that gets me
we got it!!
thanks @coymeetsworld
CamperBot
@camperbot
Jan 28 2017 04:50
jamesjd54 sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star2: 1964 | @coymeetsworld |http://www.freecodecamp.com/coymeetsworld
Coy Sanders
@coymeetsworld
Jan 28 2017 04:50
np @jamesjd54, got tripped up for a minute on the i flag on the regex
someone referenced https://www.freecodecamp.com/about/ and it says you don't need CodePen, I knew I got what I said from somewhere :)
Christopher McCormack
@cmccormack
Jan 28 2017 05:04
@coymeetsworld :clap: Thanks
CamperBot
@camperbot
Jan 28 2017 05:04
cmccormack sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star2: 1967 | @coymeetsworld |http://www.freecodecamp.com/coymeetsworld
Coy Sanders
@coymeetsworld
Jan 28 2017 05:05
no problem
Jor
@joreyesl
Jan 28 2017 05:11
camperbot back from vacation
Utkarsh Gupta
@UtkarshGupta-CS
Jan 28 2017 05:14
Ajax request to get quote api for project random quote machine
Gulsvi
@gulsvi
Jan 28 2017 05:14
I'm liking codepen so far, but seems there's a better way to stage our work
Utkarsh Gupta
@UtkarshGupta-CS
Jan 28 2017 05:15
$(function(){
    var $quotes = $('#quotes');
    $.ajax({
        type: 'GET',
        url:'https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&_=1485547119839',
        datatype:JSON,
        success:function(quotes){
            $quotes.html('<p>'+quotes.content+'</p>');
        }
    });
})
is anything wrong with this?
Gulsvi
@gulsvi
Jan 28 2017 05:15
Reading about gulp, atom, sublime....so much open source out there when I'm used to standard Microsoft stuff
oliviathomas
@oliviathomas
Jan 28 2017 05:15

var newArray = oldArray.map(function (val) {
return val + 3;
});
console.log(addThree); // returns []
console.log(oldArray); // returns []

how is this wrong?

Coy Sanders
@coymeetsworld
Jan 28 2017 05:18
can you show the whole code @oliviathomas ?
Jor
@joreyesl
Jan 28 2017 05:19
@oliviathomas is oldArray empty to begin with?
Coy Sanders
@coymeetsworld
Jan 28 2017 05:20
it probably is, im guessing addThree is the function?
Adrian Warholm
@adrianwarholm
Jan 28 2017 05:20
@SkyCoder01 I use Atom mainly for its powerful Git integration.
Utkarsh Gupta
@UtkarshGupta-CS
Jan 28 2017 05:21
which is better vscode or atom
Coy Sanders
@coymeetsworld
Jan 28 2017 05:22
they're both good @UtkarshGupta-CS
Adrian Warholm
@adrianwarholm
Jan 28 2017 05:22
@UtkarshGupta-CS They're both really good to me. IMO, I use Atom since its UIs are more user-friendly and appealing to me. Functionality wise, both are amazing.
Coy Sanders
@coymeetsworld
Jan 28 2017 05:22
i like VSCode because I can use Vim keystrokes though
although the plugin im using isnt 100%
Adrian Warholm
@adrianwarholm
Jan 28 2017 05:22
It really comes down to, "do I like the way these things execute their functionalities?"
Utkarsh Gupta
@UtkarshGupta-CS
Jan 28 2017 05:22
terminal integration is lot better in atom
Jor
@joreyesl
Jan 28 2017 05:23
@coymeetsworld i'm sure there is probably a vim package for atom somewhere
Adrian Warholm
@adrianwarholm
Jan 28 2017 05:24
I'm surprised nobody has made a front-end development studio yet.
Coy Sanders
@coymeetsworld
Jan 28 2017 05:24
yeah there is @joreyesl it didn't look that well supported when I looked at it
but that was a while ago, maybe i should check it out
Adrian Warholm
@adrianwarholm
Jan 28 2017 05:24
I mean an application other than bootstrap's.
Utkarsh Gupta
@UtkarshGupta-CS
Jan 28 2017 05:24
anyhow i m beginner in JS
i am working on Random Quote machine of FCC
$(function(){
    var $quotes = $('#quotes');
    $.ajax({
        type: 'GET',
        url:'https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&_=1485547119839',
        datatype:JSON,
        success:function(quotes){
            $quotes.html('<p>'+quotes.content+'</p>');
        }
    });
})
this code is not working
Jor
@joreyesl
Jan 28 2017 05:25
@coymeetsworld yea I dont know vim very well, but its nice to be able to navigate without having to take your hands off the keyboard to use the mouse.
oliviathomas
@oliviathomas
Jan 28 2017 05:25

var Car = function() {
// this is a private variable
var speed = 10;

// these are public methods
this.accelerate = function(change) {
speed += change;
};

this.decelerate = function() {
speed -= 5;
};

this.getSpeed = function() {
return speed;
};
};

var Bike = function() {

// Only change code below this line.

};

Coy Sanders
@coymeetsworld
Jan 28 2017 05:25
yes definitely @joreyesl, and various other shortcuts like going to begining/end of line, search/replace
oliviathomas
@oliviathomas
Jan 28 2017 05:25
this is how it starts @coymeetsworld
Coy Sanders
@coymeetsworld
Jan 28 2017 05:26
you sure @oliviathomas ? those look like 2 different challenges
whats the challenge name?
oliviathomas
@oliviathomas
Jan 28 2017 05:26
Make Object Properties Private
Coy Sanders
@coymeetsworld
Jan 28 2017 05:27
this code isn't in that challenge:
var newArray = oldArray.map(function (val) {
return val + 3;
});
console.log(addThree); // returns []
console.log(oldArray); // returns []
thats what you showed above right?
oliviathomas
@oliviathomas
Jan 28 2017 05:27
yeah that was my answer
Coy Sanders
@coymeetsworld
Jan 28 2017 05:27
answer to what though? I'm confused.
Jor
@joreyesl
Jan 28 2017 05:28
yea thats a different challenge, found it
Coy Sanders
@coymeetsworld
Jan 28 2017 05:28
yeah thats what I thought
looked familiar just forgot about it. @oliviathomas whats the issue you having and on which of the challenges?
oliviathomas
@oliviathomas
Jan 28 2017 05:29
sorry the first one i sent was the wrong challenge
Coy Sanders
@coymeetsworld
Jan 28 2017 05:29
oh ok :)
so what problem do you have with the Object Properties Private one?
oliviathomas
@oliviathomas
Jan 28 2017 05:30
im not really sure how to solve it
Coy Sanders
@coymeetsworld
Jan 28 2017 05:31
@oliviathomas you should look at how the Car is defined and do something similar
mrimosthe1
@mrimosthe1
Jan 28 2017 05:31
function abTest(a, b) {
  // Only change code below this line

  if(a<0 ||b<0){
    console.log(undefined);



  }

  // Only change code above this line

  return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
}

// Change values below to test your code
abTest(2,2);
Coy Sanders
@coymeetsworld
Jan 28 2017 05:31
you're only going to have 2 functions instead of 3. Car has accelerate/decelerate/getSpeed. Bike will have getGear/setGear
oliviathomas
@oliviathomas
Jan 28 2017 05:31
so i basically have to do the samething as the example
mrimosthe1
@mrimosthe1
Jan 28 2017 05:31
can someone tell me where am u going wrong
Coy Sanders
@coymeetsworld
Jan 28 2017 05:32
close to it yeah @oliviathomas
mrimosthe1
@mrimosthe1
Jan 28 2017 05:32
for the part Return Early Pattern for Functions
Coy Sanders
@coymeetsworld
Jan 28 2017 05:32
you're going to need an internal variable like Car has to manage the state (i.e. speed)
but I would call it gear since that's what you're setting
doesn't really matter though what you call it but thats probably best name
mrimosthe1
@mrimosthe1
Jan 28 2017 05:32

// Setup
function abTest(a, b) {
  // Only change code below this line

  if(a<0 ||b<0){
    console.log(a,b);



  }

  // Only change code above this line

  return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
}

// Change values below to test your code
abTest(2,2);
Coy Sanders
@coymeetsworld
Jan 28 2017 05:33
@spyte3n don't spam the chat please
oliviathomas
@oliviathomas
Jan 28 2017 05:33
okay thank you
mrimosthe1
@mrimosthe1
Jan 28 2017 05:33
@coymeetsworld I am not spamming
Coy Sanders
@coymeetsworld
Jan 28 2017 05:33
np good luck
mrimosthe1
@mrimosthe1
Jan 28 2017 05:33
I am just asking for help
Coy Sanders
@coymeetsworld
Jan 28 2017 05:33
yes please don't post your code multiple times
mrimosthe1
@mrimosthe1
Jan 28 2017 05:34
can yu help @coymeetsworld
Coy Sanders
@coymeetsworld
Jan 28 2017 05:34
i was helping someone else at the time, you need to be more patient
mrimosthe1
@mrimosthe1
Jan 28 2017 05:34
ok
Coy Sanders
@coymeetsworld
Jan 28 2017 05:34
your if statement doesn't do anything, just prints out a log value
you want to issue a return statement
mrimosthe1
@mrimosthe1
Jan 28 2017 05:35
I tried using return statement
Coy Sanders
@coymeetsworld
Jan 28 2017 05:35
what was it?
mrimosthe1
@mrimosthe1
Jan 28 2017 05:35
return (a,b);
Coy Sanders
@coymeetsworld
Jan 28 2017 05:35
what does the challenge say to return if either number is negative?
mrimosthe1
@mrimosthe1
Jan 28 2017 05:36
undefined
Coy Sanders
@coymeetsworld
Jan 28 2017 05:36
so return that :)
mrimosthe1
@mrimosthe1
Jan 28 2017 05:37
man it worked
I used iy woth console.log undefined
Coy Sanders
@coymeetsworld
Jan 28 2017 05:37
ya
mrimosthe1
@mrimosthe1
Jan 28 2017 05:37
did not work
Coy Sanders
@coymeetsworld
Jan 28 2017 05:37
console.log doesn't do anything to the code, its just used for debugging/logging
mrimosthe1
@mrimosthe1
Jan 28 2017 05:37
thanks @coymeetsworld
CamperBot
@camperbot
Jan 28 2017 05:37
spyte3n sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star2: 1969 | @coymeetsworld |http://www.freecodecamp.com/coymeetsworld
Coy Sanders
@coymeetsworld
Jan 28 2017 05:38
np
mrimosthe1
@mrimosthe1
Jan 28 2017 05:38
okay
someone help me on this one ..its not working
Chinedu
@chinedualumba
Jan 28 2017 05:57
I can't seem to figure out the switch challenge. can anyone help me?
mrimosthe1
@mrimosthe1
Jan 28 2017 06:05
@chinedualumba which?
send the code
Chinedu
@chinedualumba
Jan 28 2017 06:06

@spyte3n this onefunction caseInSwitch(val) {
var answer = "";
// Only change code below this line

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

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

@spyte3n i thought it would simply be opening a switch (answer) { }
adding some cases where answer = blah in each case but it's not working.
Pond
@phakasem
Jan 28 2017 06:10
Hello, console in codepen doesn't response in chrome. How do i fix it?
Chigoziem Nwaiwu
@mindsworth
Jan 28 2017 06:10
any idea on how to Return string with the first letter of each word capitalized???
mrimosthe1
@mrimosthe1
Jan 28 2017 06:12
which excercise is this @chinedualumba
Chinedu
@chinedualumba
Jan 28 2017 06:13
@spyte3n it is the Selecting from many options with Switch Statements exercise
Pond
@phakasem
Jan 28 2017 06:16
@mindsworth 1st you separate the string into single word, 2nd locate the first letter and separate it, 3rd make it a capital, 4 th regroup it into the word and so on. You can do it with other approach.
gitSnake
@GitSnake
Jan 28 2017 06:16
For some reason I'm having difficulty with the Madlibs exercise
Chinedu
@chinedualumba
Jan 28 2017 06:19
@GitSnake you just need to create a sentence by concatenating your own words plus the already defined variables.
oliviathomas
@oliviathomas
Jan 28 2017 06:20

array = oldArray.filter(function(val) {

return val <= 5;

});

var newArray = oldArray;

help?
gitSnake
@GitSnake
Jan 28 2017 06:23
@chinedualumba Ah ok. I'll try that. Thank you
CamperBot
@camperbot
Jan 28 2017 06:23
:cookie: 192 | @chinedualumba |http://www.freecodecamp.com/chinedualumba
gitsnake sends brownie points to @chinedualumba :sparkles: :thumbsup: :sparkles:
mrimosthe1
@mrimosthe1
Jan 28 2017 06:24
you need to specify each case first @chinedualumba
write down the cases one by one
you there @chinedualumba ?
Chinedu
@chinedualumba
Jan 28 2017 06:27
@spyte3n i wrote it down like so:
switch (answer){
case 1:
answer = "alpha";
break;
case 2:
  answer = "beta";
  break;

case 3:
  answer = "gamma";

  break;
heroiczero
@heroiczero
Jan 28 2017 06:28

@UtkarshGupta-CS

var quotesFromApi= function(){
    var $quotes = $('#quotes');
    $.ajax({
      method:"GET",
        url:'http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback=JSONP',
        datatype:"JSONP",
        success:function(quotes){
          console.log(quotes[0].content);  $quotes.html('<p>'+quotes[0].content+'</p>');
        }
    });
}
$(document).ready(function(){
    quotesFromApi();
});

try that for your API. first your datatype needs "" and need to define the function before you use it

mrimosthe1
@mrimosthe1
Jan 28 2017 06:29
@chinedualumba how will the output come if you have not returned the values
use return
Chinedu
@chinedualumba
Jan 28 2017 06:30
@spyte3n there's a return statement outside the switch method.
mrimosthe1
@mrimosthe1
Jan 28 2017 06:31
yes but its empty you see @chinedualumba
Chinedu
@chinedualumba
Jan 28 2017 06:35
@spyte3n sorry still not getting it. i guess i must be slow
MRamsey95
@MRamsey95
Jan 28 2017 06:41
@chinedualumba It should be switch(val) instead of switch(answer)
Chinedu
@chinedualumba
Jan 28 2017 06:44
@MRamsey95 omg. thank you so much. i thought so at first but i was like no way it'll be that. lol
CamperBot
@camperbot
Jan 28 2017 06:44
chinedualumba sends brownie points to @mramsey95 :sparkles: :thumbsup: :sparkles:
:cookie: 241 | @mramsey95 |http://www.freecodecamp.com/mramsey95
Chinedu
@chinedualumba
Jan 28 2017 06:44
@spyte3n thanks for trying to lead me there
CamperBot
@camperbot
Jan 28 2017 06:44
chinedualumba sends brownie points to @spyte3n :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for spyte3n
Sahil Sunny
@sahilsunny
Jan 28 2017 06:45
regex not matching

function telephoneCheck(str) {
  if(str.match("/[1]?[\s]?\d{3}[-\s]?\d{3}[-\s]?\d{4}/")) {
    return true;
  }
  else {
    return false;
  }
}



telephoneCheck("1 555-555-5555");
Flash
@DanishGlover
Jan 28 2017 06:45
Hello How do you increment a number in Javascript
Sahil Sunny
@sahilsunny
Jan 28 2017 06:45
but its matching as per https://regex101.com/
dsillydude
@dsillydude
Jan 28 2017 06:45

a lil help here mates?

//Setup
var contacts = [
{
"firstName": "Akira",
"lastName": "Laine",
"number": "0543236543",
"likes": ["Pizza", "Coding", "Brownie Points"]
},
{
"firstName": "Harry",
"lastName": "Potter",
"number": "0994372684",
"likes": ["Hogwarts", "Magic", "Hagrid"]
},
{
"firstName": "Sherlock",
"lastName": "Holmes",
"number": "0487345643",
"likes": ["Intriguing Cases", "Violin"]
},
{
"firstName": "Kristian",
"lastName": "Vos",
"number": "unknown",
"likes": ["Javascript", "Gaming", "Foxes"]
}
];

function lookUpProfile(firstName, prop){
// Only change code below this line
if(firstName.hasOwnProperty(prop))

return firstName(prop);

else {
return "No such contact";
}

if(prop === firstName.hasOwnProperty(prop))
// Only change code above this line
return firstName(prop);

else {
  return "Nos such property";
}

}

// Change these values to test your function
lookUpProfile("Akira", "likes");

why my code wont function?

Sahil Sunny
@sahilsunny
Jan 28 2017 06:45
@DanishGlover by using i++
Flash
@DanishGlover
Jan 28 2017 06:46
o
__SharifTarver__
@Sharifdesigns22
Jan 28 2017 06:49

// Example
var changed = 0;

function change(num) {
return (num + 5) / 3;

changed = change(10);

// Setup
var processed = 0;

function processArg(num) {
  return (num + 3) / 5;
}

// Only change code below this line
var processed = 2; 
function processArg(processed) {
  return (num + 0);

}

How do I assign processArg to processed

Sahil Sunny
@sahilsunny
Jan 28 2017 06:50
any regex pro here?
I have problem with matching us telephone numbers
Brent Ingram
@bingr001
Jan 28 2017 06:50
I'm working on Testing Object for Properties and I succeed in passing the first two tests but not the third. How do I get it to pass the "Not Found" part?
// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {

  if(myObj.hasOwnProperty("checkProp"));
  {return myObj[checkProp];}

  return "Not Found";    

}

// Test your code by modifying these values
checkObj("gift");
oliviathomas
@oliviathomas
Jan 28 2017 06:51
array = array.filter(function(val) {
return val >= 5;
});
help?
Brent Ingram
@bingr001
Jan 28 2017 06:51
crud, I don't know how to make it look like code better. sorry everybody.
Darth Skywalker
@adityaparab
Jan 28 2017 06:52

@bingr001

if you type

```js
console.log('This looks like code. Such formatting. Much beauty. Wowe');
```

you will see

console.log('This looks like code. Such formatting. Much beauty. Wowe');
Brent Ingram
@bingr001
Jan 28 2017 06:55
@adityaparab Got it! Thanks!
CamperBot
@camperbot
Jan 28 2017 06:55
:cookie: 889 | @adityaparab |http://www.freecodecamp.com/adityaparab
bingr001 sends brownie points to @adityaparab :sparkles: :thumbsup: :sparkles:
Sahil Sunny
@sahilsunny
Jan 28 2017 06:56
please I need help with regex anyone?
my regex is correct as per https://regex101.com/

i even tried to check if fcc is providing me different result by using this code:

function telephoneCheck(str) {
  var regexp = /[1]?[\s(]?\d{3}[)-\s]?\d{3}[-\s]?\d{4}/;
  var regmatch = regexp.exec(str);
  return regmatch[0];
}



telephoneCheck("1 555-555-5555");

its returning the sane value that means its a match right?

Rafael Monroy
@rafaelmonroy
Jan 28 2017 07:08
can any one help me with this
Stand in Line
function nextInLine(arr, item) {
  // Your code here
  arr.push(1);
  arr.shift();
  return item + 1;  // Change this line
}

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

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 1)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
Darth Skywalker
@adityaparab
Jan 28 2017 07:10
@rafaelmonroy you just have to return the result of arr.shift()
Sudhanshu Mishra
@rocky3031
Jan 28 2017 07:10
function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line
  for (i = 0; i < arr.length; i++) {
    for( j = 0; j < arr[i].length; i++) {
      product = ([i]*[j]);
    }
  }
  // Only change code above this line
  return product;
}

// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);
what is worng?
Darth Skywalker
@adityaparab
Jan 28 2017 07:11
@rocky3031 product = ([i]*[j]); should look like product *= arr[i][j];
Sudhanshu Mishra
@rocky3031
Jan 28 2017 07:13
@adityaparab thanks
CamperBot
@camperbot
Jan 28 2017 07:13
rocky3031 sends brownie points to @adityaparab :sparkles: :thumbsup: :sparkles:
:cookie: 890 | @adityaparab |http://www.freecodecamp.com/adityaparab
Rafael Monroy
@rafaelmonroy
Jan 28 2017 07:13
@adityaparab how do i add a number to the end of the array
Sujeevan
@sujeevan81
Jan 28 2017 07:13

// Setup
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh"
};

function checkObj(checkProp) {
// Your Code Here

if(myObj.hasOwnProperty("checkProp"===true)){

return myObj[checkProp];

}

else {
return "Not Found";
}

}

// Test your code by modifying these values
checkObj("pet");

can anyone help?
Rafael Monroy
@rafaelmonroy
Jan 28 2017 07:13
@adityaparab can i return 2 things
Darth Skywalker
@adityaparab
Jan 28 2017 07:14
@rafaelmonroy technically, you can't
Sujeevan
@sujeevan81
Jan 28 2017 07:14
I can't call the myObj properties
Sudhanshu Mishra
@rocky3031
Jan 28 2017 07:14
@adityaparab did't work :(
Sahil Sunny
@sahilsunny
Jan 28 2017 07:14
@rafaelmonroy array.push(number);
Rafael Monroy
@rafaelmonroy
Jan 28 2017 07:16

function nextInLine(arr, item) {
  // Your code here

  return arr.shift(),arr.push(item);  // Change this line
}

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

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 1)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
Darth Skywalker
@adityaparab
Jan 28 2017 07:17
@rocky3031 : You have a problem in second for loop. You're incrementing i instead of j
for( j = 0; j < arr[i].length; i++) {
it should be
for( j = 0; j < arr[i].length; j++) {
@rafaelmonroy
function nextInLine(arr, item) {
  // Your code here
  arr.push(item);
  return arr.shift();
}
Sudhanshu Mishra
@rocky3031
Jan 28 2017 07:17
@adityaparab oh... thanks
CamperBot
@camperbot
Jan 28 2017 07:17
:warning: rocky3031 already gave adityaparab points
rocky3031 sends brownie points to @adityaparab :sparkles: :thumbsup: :sparkles:
__SharifTarver__
@Sharifdesigns22
Jan 28 2017 07:18

// Example
var changed = 0;

function change(num) {
return (num + 5) / 3;

changed = change(10);

// Setup
var processed = 0;

function processArg(num) {
  return (num + 3) / 5;
}

// Only change code below this line
var processed = 2; 
function processArg(processed) {
  return (num + 0);

}

How do I assign processArg to processed

Rafael Monroy
@rafaelmonroy
Jan 28 2017 07:18
@adityaparab ahh i see, that worked thanks!
CamperBot
@camperbot
Jan 28 2017 07:18
rafaelmonroy sends brownie points to @adityaparab :sparkles: :thumbsup: :sparkles:
:cookie: 891 | @adityaparab |http://www.freecodecamp.com/adityaparab
Rafael Monroy
@rafaelmonroy
Jan 28 2017 07:19
@sahilsunny thanks too!
CamperBot
@camperbot
Jan 28 2017 07:19
rafaelmonroy sends brownie points to @sahilsunny :sparkles: :thumbsup: :sparkles:
:cookie: 310 | @sahilsunny |http://www.freecodecamp.com/sahilsunny
Jor
@joreyesl
Jan 28 2017 07:27
@Sharifdesigns22 ok first, they already created the function processArg so no need to create it again.
What you want to do is call the function with the given argument and assign it to the variable processed.
ex:
function myFunction(num) {
   return (num + 3) /5;
}

var myNum = myFunction(7);
Ghost
@ghost~58864d03d73408ce4f457acc
Jan 28 2017 07:34
Hello, I didnt catch the poiont of Word Blanks :(
It is in JavaScript Basic lesson.. someone to help me please?
Robert Purcea
@RobertPurcea
Jan 28 2017 07:35

what's going on here. Why do I have 2 elements on console instead of 1?

var main = {
    exMain : function() {
        var sub = {
            exSub : function() {
                console.log(this.val);
            },
            val : "B"
        };
        return sub;
    },
    val : "main"
};

console.log(main.exMain().exSub());

Please help

I may be blind or something, dk
Chigoziem Nwaiwu
@mindsworth
Jan 28 2017 07:36
@camperbot .. welcome back
@Robertb4 ... exMain is not a function
is an object property that has a method value
Robert Purcea
@RobertPurcea
Jan 28 2017 07:39
console.log(typeof main.exMain); //function
You sure?
Chukwuemeka Lionel Okoro
@3m3kalionel
Jan 28 2017 07:40
took a break from my random quotes machine because everything is working except one thing.. my tweet button opens a new link but does not display the quotes for me to tweet
Robert Purcea
@RobertPurcea
Jan 28 2017 07:40
I just run that
Chigoziem Nwaiwu
@mindsworth
Jan 28 2017 07:40
yes
Chukwuemeka Lionel Okoro
@3m3kalionel
Jan 28 2017 07:40
any help
please
Chigoziem Nwaiwu
@mindsworth
Jan 28 2017 07:40
@Robertb4 .. What do u want to access there?
Sudhanshu Mishra
@rocky3031
Jan 28 2017 07:41
//Setup
var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intriguing Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    }
];


function lookUpProfile(firstName, prop){
// Only change code below this line

  if ( firstName === true){
    if (prop === true){
    return contacts.firstname.prop;
  } 
  else { return "No such property";}
} 
  else { return "No such Contact";}
// Only change code above this line
}

// Change these values to test your function
lookUpProfile("Akira", "likes");
what is worng??
plz help
Robert Purcea
@RobertPurcea
Jan 28 2017 07:41
I was just trying to understand the 'this' keyword better @mindsworth
Chigoziem Nwaiwu
@mindsworth
Jan 28 2017 07:43
@Robertb4 ... in what contest?
Robert Purcea
@RobertPurcea
Jan 28 2017 07:44
what do you mean by contest? @mindsworth
Chigoziem Nwaiwu
@mindsworth
Jan 28 2017 07:45
@rocky3031 ... you have to loop through to check if firstName exist and the prop with .hasOwnProperty
Chigoziem Nwaiwu
@mindsworth
Jan 28 2017 07:46
"this" is a global function and in works in different ways
Robert Purcea
@RobertPurcea
Jan 28 2017 07:47
thanks @mstellaluna @mindsworth
CamperBot
@camperbot
Jan 28 2017 07:47
robertb4 sends brownie points to @mstellaluna and @mindsworth :sparkles: :thumbsup: :sparkles:
:cookie: 244 | @mindsworth |http://www.freecodecamp.com/mindsworth
:cookie: 535 | @mstellaluna |http://www.freecodecamp.com/mstellaluna
Chigoziem Nwaiwu
@mindsworth
Jan 28 2017 07:47
@Robertb4 ... follow suit @mstellaluna links .. there's much to learn there
u welcome
Vijith Nair
@wizelmagnifico
Jan 28 2017 07:52

var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh"
};

function checkObj(checkProp) {
// Your Code Here
if(myObj.hasOwnProperty("checkProp")===true) {
return myObj[checkProp];
}else

return "Not Found";

}

// Test your code by modifying these values
checkObj("gift");

what am I doing wrong here?
can anybpdy help?
mstellaluna
@mstellaluna
Jan 28 2017 07:53
@wizelmagnifico your else statement is missing its { }
Chigoziem Nwaiwu
@mindsworth
Jan 28 2017 07:53
@wizelmagnifico ... first remove the double quote in ur hasOwnProperty("checkProp")
@wizelmagnifico ... it will still work without the else braces
@wizelmagnifico ... let me know if u are able to fix it
Chukwuemeka Lionel Okoro
@3m3kalionel
Jan 28 2017 08:03
@bingr001 found a solution yet?
mstellaluna
@mstellaluna
Jan 28 2017 08:05
@mindsworth that may be true.. but the { } after else are a standard and I'm not sure if FCC is super picky about it :)
Sandeep Chary
@dsandeepchary
Jan 28 2017 08:07

someone help to add the same interaction to all qquestions like the first one # here

Chigoziem Nwaiwu
@mindsworth
Jan 28 2017 08:07
@mstellaluna ... maybe ... are lets adhered to the standard
DKamon
@DKamon
Jan 28 2017 08:07
function chunkArrayInGroups(arr, size) {
var a,b,c,d,i;
a=[];
b=arr.slice(0,size);
for(i=size;i<=arr.length;i+=size){
c=arr.slice(0,i);
d=a.push(c);
}
return a;
}
can anyone help me with this?
Jor
@joreyesl
Jan 28 2017 08:08
@DKamon try .splice instead of .slice
Sandeep Chary
@dsandeepchary
Jan 28 2017 08:09
Chigoziem Nwaiwu
@mindsworth
Jan 28 2017 08:10
@dsandeepchary .. let you just learn the trick
is working LOL
Sandeep Chary
@dsandeepchary
Jan 28 2017 08:11
Someone look into my issue
DKamon
@DKamon
Jan 28 2017 08:11
@joreyesl ot working with splice
*not
Chigoziem Nwaiwu
@mindsworth
Jan 28 2017 08:12
@dsandeepchary ... what are you up to?
@DKamon ... what
DKamon
@DKamon
Jan 28 2017 08:13
function chunkArrayInGroups(arr, size) {
var a,b,c,d,i;
a=[];
b=arr.slice(0,size);
for(i=size;i<=arr.length;i+=size){
c=arr.slice(0,i);
d=a.push(c);
}
return a;
}
DKamon
@DKamon
Jan 28 2017 08:13
@mindsworth
Jor
@joreyesl
Jan 28 2017 08:13
@DKamon remove this line b=arr.slice(0,size); change this c=arr.slice(0,i); to c=arr.slice(0,size);
Ali
@M-Ali-B
Jan 28 2017 08:13
Hi @joreyesl
Sandeep Chary
@dsandeepchary
Jan 28 2017 08:13
Jor
@joreyesl
Jan 28 2017 08:13
@M-Ali-B hi :)
Ali
@M-Ali-B
Jan 28 2017 08:14
:smile:
Jor
@joreyesl
Jan 28 2017 08:15
@M-Ali-B how are you
Ali
@M-Ali-B
Jan 28 2017 08:15
freecodecamp2.PNG
@joreyesl now you can see :smile:
Chigoziem Nwaiwu
@mindsworth
Jan 28 2017 08:16
splice and slice ... both are correct but work differently
bradulz
@bradulz
Jan 28 2017 08:16
hey can someone tell me an easy way of filling a 2d array with the same string? I tried using .fill but it doesnt work properly
Jor
@joreyesl
Jan 28 2017 08:18
@M-Ali-B remove [1] from myMusic[1] and add another record
DKamon
@DKamon
Jan 28 2017 08:19
@mindsworth see if its better now

function chunkArrayInGroups(arr, size) {
var a,b,c,d,i;
a=[];

for(i=size;i<=arr.length;i+=size)
for(k=0;k<i;k+=size){
c=arr.slice(k,i);
d=a.push(c);
}
return a;
}

chunkArrayInGroups(["a", "b", "c", "d"], 2);

Ali
@M-Ali-B
Jan 28 2017 08:20
@joreyesl how
Jor
@joreyesl
Jan 28 2017 08:20
@DKamon get rid of for(k=0;k<i;k+=size){, change this c=arr.slice(k,i); to c=arr.slice(i,size);, start loop at for(i=p;
Chigoziem Nwaiwu
@mindsworth
Jan 28 2017 08:20
@DKamon ... follow standard .. open and close the braces {} for the first for loop
Ali
@M-Ali-B
Jan 28 2017 08:20
add another record , I did not get it
DKamon
@DKamon
Jan 28 2017 08:22
what is p @joreyesl
Jor
@joreyesl
Jan 28 2017 08:22
@M-Ali-B
myMusic = [
 {
   "artist" : "Adam Lavine",
     ...ect.
},
{
 ///add record 2 here

}
]
bradulz
@bradulz
Jan 28 2017 08:22
@mindsworth ive done var one = Array(9).fill(Array(9).fill("")); with .fill but if I use one[1][0] = "string"``` it sets the whole column to "string" instead of the one cell
Jor
@joreyesl
Jan 28 2017 08:22
@DKamon oh sorry typo, meant 0
Ali
@M-Ali-B
Jan 28 2017 08:23
@joreyesl :+1:
Topnotch
@raahi12
Jan 28 2017 08:24
hey i used a for loop to iterate an array with condition that it continues till var i=-1, and it is showing an infinite loop how?
Manish Giri
@Manish-Giri
Jan 28 2017 08:24
@raahi12 check where the loop terminates
DKamon
@DKamon
Jan 28 2017 08:24

a=[];

for(i=0;i<=arr.length;i+=size){
for(k=0;k<i;k+=size){
c=arr.slice(i,size);
d=a.push(c);
}
}
return a;
}

@joreyesl
somthing is still not right
Topnotch
@raahi12
Jan 28 2017 08:25
@Manish-Giri the array has fixed number of elements then how does it becomes infinite loop since i=-1 represents last element of array
Manish Giri
@Manish-Giri
Jan 28 2017 08:26
@raahi12 like I said check if your loop condition is right, I can't say without seeing your code.
Sandeep Chary
@dsandeepchary
Jan 28 2017 08:26
:point_up: January 28, 2017 1:37 PM @Manish-Giri
Topnotch
@raahi12
Jan 28 2017 08:27
@Manish-Giri var total=0;
for (var i=0;i<myArr.length;i++){
total +=myArr[i];
}
Manish Giri
@Manish-Giri
Jan 28 2017 08:27
@dsandeepchary lol, nice idea!!
Sandeep Chary
@dsandeepchary
Jan 28 2017 08:27
Need help dude @Manish-Giri
Jor
@joreyesl
Jan 28 2017 08:28
@DKamon alright, i'll try running it on my end, 1 sec
Topnotch
@raahi12
Jan 28 2017 08:28
@Manish-Giri here i had to use length of array instead of ending at last element that can be done by putting i=-1
Manish Giri
@Manish-Giri
Jan 28 2017 08:29
@raahi12 you tried another code that didn't work? show that then
Chigoziem Nwaiwu
@mindsworth
Jan 28 2017 08:29
@DKamon ... Did it work?
Manish Giri
@Manish-Giri
Jan 28 2017 08:29
@dsandeepchary with?
not sure what's not working in there
DKamon
@DKamon
Jan 28 2017 08:29
nope @mindsworth
Topnotch
@raahi12
Jan 28 2017 08:30

@Manish-Giri var myArr = [ 2, 3, 4, 5, 6];

// Only change code below this line
var total=0;
for (var i=0;i=-1;i++){
total +=myArr[i];
}

Chigoziem Nwaiwu
@mindsworth
Jan 28 2017 08:30
let me see ur code again pls
Sandeep Chary
@dsandeepchary
Jan 28 2017 08:30
the same I'm working on @Manish-Giri
dropdown isn't working with remaining questions
Manish Giri
@Manish-Giri
Jan 28 2017 08:31
@raahi12 it's wrong - for (var i=0;i=-1;i++)
Jor
@joreyesl
Jan 28 2017 08:31
@DKamon change c=arr.slice(i,size); to c=arr.slice(i, i + size);
DKamon
@DKamon
Jan 28 2017 08:31

a=[];

for(i=0;i<=arr.length;i+=size){
for(k=0;k<i;k+=size){
c=arr.slice(i,size);
d=a.push(c);
}
}
return a;
}

@mindsworth
Manish Giri
@Manish-Giri
Jan 28 2017 08:31
@dsandeepchary so the big box with placeholder question is supposed to be a dropdown?
Topnotch
@raahi12
Jan 28 2017 08:32
@Manish-Giri how , doesn't i=-1 goes on till last element or /0
Manish Giri
@Manish-Giri
Jan 28 2017 08:32
@raahi12 no? why would it? i = -1 is just assignment of -1 to i
Sandeep Chary
@dsandeepchary
Jan 28 2017 08:32
Nope :disappointed:
@Manish-Giri
Chigoziem Nwaiwu
@mindsworth
Jan 28 2017 08:33
@DKamon .. the function too pls
Topnotch
@raahi12
Jan 28 2017 08:33
@Manish-Giri thanks i understood
CamperBot
@camperbot
Jan 28 2017 08:33
raahi12 sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 3963 | @manish-giri |http://www.freecodecamp.com/manish-giri
Sandeep Chary
@dsandeepchary
Jan 28 2017 08:33
Add Question button lets us add more questions
and those questions have a dropdown beside them
I want them to work like it work with the dropdown beside first question @Manish-Giri
Manish Giri
@Manish-Giri
Jan 28 2017 08:33
@raahi12 if you want to loop till the last array element, it would be i <= myArr.length-1
Brytista
@Brytista
Jan 28 2017 08:35
Yow
Returning Boolean Values from Functions
CAN ANYONE HELP ME WITH THAT'
hey
Chigoziem Nwaiwu
@mindsworth
Jan 28 2017 08:37
@Brytista ......... just return true
or return false
Brytista
@Brytista
Jan 28 2017 08:38
How

function isLess(a, b) {
// Fix this code
return a===b;

}

// Change these values to test
isLess(10, 15);

Hey
Darth Skywalker
@adityaparab
Jan 28 2017 08:38
@Brytista you need to use < operator
not equality operator
Chigoziem Nwaiwu
@mindsworth
Jan 28 2017 08:39
@Brytista ..
function isLess(a, b) {
  // Fix this code
 return a < b;

}

// Change these values to test
isLess(10, 15);
Lukas Balabonas
@balabis
Jan 28 2017 08:51
hi. how can i make this line return true for confirmEnding("Open sesame", "same") ?
if (target == str.substring(str.length - 1)) {
return true;
} else if (target == str.substr(str.lastIndexOf(' ') + 1)) {
return true;
} else {
return false;
}
Anish Tamang
@anish1144
Jan 28 2017 08:53

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");

can someone explain me this challenge please
moeahmed24
@moeahmed24
Jan 28 2017 08:54
i need help with returning sub arrays and object lookups
Ogundele Olumide
@Lumexralph
Jan 28 2017 08:55
@anish1144 do you understand how to concatenate strings using +?
@moeahmed24 ask your question
Anish Tamang
@anish1144
Jan 28 2017 08:56
yes
Ogundele Olumide
@Lumexralph
Jan 28 2017 08:57
@anish1144 do that with all your parameters separated by space e. g myNoun + " " +.....
@balabis are you writing a function?
moeahmed24
@moeahmed24
Jan 28 2017 08:58
var completeList = "";
for (i = 0; i < contacts.length; i++){
for (j=0; j<contacts[i].length;j++){
completeList = contacts[i][j];
}
}
return completeList;
the completeList doesnt return anything bro what should i do @Lumexralph
Ogundele Olumide
@Lumexralph
Jan 28 2017 08:59
@moeahmed24 what are you trying to do?
Jor
@joreyesl
Jan 28 2017 08:59
@balabis well substring can take 2 arguments. .substring(startIndex, endIndex). Since we will be looking at the end of the string, we can skip 2nd argument. Now we need to do some match to calculate the startIndex. We can do that with target.length - str.length but we need it positive, so encase that in Math.abs()
Anish Tamang
@anish1144
Jan 28 2017 08:59
alright thanks @Lumexralph
CamperBot
@camperbot
Jan 28 2017 08:59
anish1144 sends brownie points to @lumexralph :sparkles: :thumbsup: :sparkles:
:cookie: 868 | @lumexralph |http://www.freecodecamp.com/lumexralph
Ogundele Olumide
@Lumexralph
Jan 28 2017 08:59
@moeahmed24 doing completeList = contacts[i][j]; will assign difference arrays values to completeList at every iteration
@anish1144 :+1:
moeahmed24
@moeahmed24
Jan 28 2017 09:00
im tryna create a profile lookup function that takes in an object with arrays of different profiles
Lukas Balabonas
@balabis
Jan 28 2017 09:00
blob
Ogundele Olumide
@Lumexralph
Jan 28 2017 09:00
@moeahmed24 you need just one loop
moeahmed24
@moeahmed24
Jan 28 2017 09:00
the function takes in a property then returns the value of that property
Ogundele Olumide
@Lumexralph
Jan 28 2017 09:00
@balabis can you post the code? than a snapshot
Michael Schmidt
@lafisrap
Jan 28 2017 09:01

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

// Only change code below this line
function updateRecords(id, prop, value) {

var col = collection[id];

if( !col ) return;

if( prop !== "tracks" ) {
console.log(1, id, prop, value, col[prop]);
if( value && value !== "" ) col[prop] = value;
console.log(2, id, prop, value, col[prop]);
} else {
if( !col[prop] ) col[prop] = [];

if( value && value !== "" ) col[prop].push( value );
else delete col[prop];

}
return collection;
}

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

All tests pass, except this one: ´´´After updateRecords(2548, "artist", ""), artist should not be set´´´
The console prints:
´´´
1 2548 "artist" "" "Bon Jovi"

2 2548 "artist" "" "Bon Jovi"
What is wrong?
Lukas Balabonas
@balabis
Jan 28 2017 09:02
this code passed, but i need to modify it, like @joreyesl said
function confirmEnding(str, target) {
if (target == str.substring(str.length - 1)) {
return true;
} else if (target == str.substr(str.lastIndexOf(' ') + 1)) {
return true;
} else if (target == str.substr(-4)) {
return true;
} else {
return false;
}
}
moeahmed24
@moeahmed24
Jan 28 2017 09:02
for real? i tried that but it only shows me the first array and ignores the rest
Ogundele Olumide
@Lumexralph
Jan 28 2017 09:02
@moeahmed24 show your full code
Michael Schmidt
@lafisrap
Jan 28 2017 09:02
@balabis What is your problem?
<