These are chat archives for FreeCodeCamp/HelpJavaScript

6th
Jan 2017
Simon Cordova
@gbsimon87
Jan 06 2017 00:01
In about a month's time I'm going to start getting into the backend, any recommendations on what to learn first?
I've touched up on Python before but that was a while ago and barely remember it.
BoxOfCereal
@BoxOfCereal
Jan 06 2017 00:01
@HeebieGeeBee of all the things to blow a mill on
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 00:01
i know right, madness
Joseph
@revisualize
Jan 06 2017 00:02
@gbsimon87 Node.js?
Simon Cordova
@gbsimon87
Jan 06 2017 00:03
@sjames1958gm any suggestions as well?
Cheers @revisualize on the input btw
Are there any backend languages that are primarily used?
Stephen James
@sjames1958gm
Jan 06 2017 00:04
@gbsimon87 THat link shows some PHP - which is probably the majority language
Simon Cordova
@gbsimon87
Jan 06 2017 00:06
Is learning PHP a recommended approach these days, as oppose to say, learning Node.js first?
I once read an article that Python would be taking over, but this doesn't seem to be the case at all.
@peterito still need help?
Stephen James
@sjames1958gm
Jan 06 2017 00:09
@gbsimon87 I am not sure - nodejs is more interesting to me, but PHP might be more marketable
Simon Cordova
@gbsimon87
Jan 06 2017 00:11
When you say more marketable, do you mean it's used more so knowledge of it may be more benificial, at least for the moment?
beneficial**
peter oyebamiji
@peterito
Jan 06 2017 00:11
@gbsimon87 i cant stii figure out how to pass that challenge still giving me error
Simon Cordova
@gbsimon87
Jan 06 2017 00:11
@peterito post your code
Stephen James
@sjames1958gm
Jan 06 2017 00:12
@gbsimon87 yes
Simon Cordova
@gbsimon87
Jan 06 2017 00:12
@peterito use three backticks ( ` ). They're usually to the left of the 1 key. Then type your code, then put 3 backticks again.
@sjames1958gm hmm..interesting, that may be a route I'd like to take haha
peter oyebamiji
@peterito
Jan 06 2017 00:14

@gbsimon87
function nextInLine(arr, item) {
// Your code here
console.log([1,2,3], "paul");
nextInLine = arr.push(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, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));

Simon Cordova
@gbsimon87
Jan 06 2017 00:15
@peterito, ok, so the first line in your code will look something like this...
Mike
@MikeJSchorah
Jan 06 2017 00:15
@gbsimon87 Could I ask you a question about your new job?
peter oyebamiji
@peterito
Jan 06 2017 00:16
@gbsimon87 just getting it wrong
Stephen James
@sjames1958gm
Jan 06 2017 00:16
@peterito nextInLine is the function name - not likely to be used inside the function.
use arr and item - first add item to end of arr - then remove the first value from arr and return it
webimdesign
@webimdesign
Jan 06 2017 00:17
Hello
Simon Cordova
@gbsimon87
Jan 06 2017 00:17
function nextInLine(arr, item) {
  elementToUse.methodToUse(whatToPushIntoTheElement);
}
webimdesign
@webimdesign
Jan 06 2017 00:17
Hello guys

Reverse the provided string.

You may need to turn the string into an array before you can reverse it.

Your result must be a string.

can anyone help me with this?
Stephen James
@sjames1958gm
Jan 06 2017 00:17
@webimdesign Did you look at the links for split and join?
Simon Cordova
@gbsimon87
Jan 06 2017 00:17
@MikeJSchorah sure whats up
Mike
@MikeJSchorah
Jan 06 2017 00:18
Is it easier than what's needed to do in the Intermediate Projects?
webimdesign
@webimdesign
Jan 06 2017 00:18

function reverseString(str) {
var array = str.split(" ");
array.reverse();
array.toString();
return array;
}

reverseString("hello");

i did this, but i don't know...
@sjames1958gm I did , i did the course too, but i am fucked up now
Stephen James
@sjames1958gm
Jan 06 2017 00:19
@webimdesign So to reverse you need to split on characters not words - so use '' not ' '
Simon Cordova
@gbsimon87
Jan 06 2017 00:20

@MikeJSchorah some of it is, and some isn't, it really depends on the project...
Tbh my job uses a lot of jquery and javascript, but not much algorithms, but don't deter on doing these algorithms.

To get better at my work I've returned to working on the algorithms, literally.

webimdesign
@webimdesign
Jan 06 2017 00:20
'not' instead of " " ?
Stephen James
@sjames1958gm
Jan 06 2017 00:20
@webimdesign Once you reverse the array - join is how you put it back together
@webimdesign '' empty string
Simon Cordova
@gbsimon87
Jan 06 2017 00:20
Using the methods correctly heavily increase my workflow.
Mike
@MikeJSchorah
Jan 06 2017 00:22
@gbsimon87 I was thinking about applying. I'm comfortable with everything up until the algorithms section. I understand how to do them now, same with the Intermediate Projects. I used an online tutorial to do the Intermediate Projects, but really spent some time analyzing them. I looked in a 200 mile search and it's saying that 600 junior developer jobs are available.
webimdesign
@webimdesign
Jan 06 2017 00:22
@sjames1958gm Thank you ,i understand now
CamperBot
@camperbot
Jan 06 2017 00:22
webimdesign sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 5188 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
webimdesign
@webimdesign
Jan 06 2017 00:22
@sjames1958gm But it is not reversing the array...
Stephen James
@sjames1958gm
Jan 06 2017 00:23
@webimdesign When you use join it returns a string that you return
Simon Cordova
@gbsimon87
Jan 06 2017 00:23
@MikeJSchorah don't be afraid to apply, just don't water down your CV, if you don't know how to use a language, don't mark it down...
But if you feel comfortable with the intermediate projects and at least the beginner algorithms, i'd start applying for junior jobs
One tip I'll give you though, is take a separate course or two on DOM traversal.
Mike
@MikeJSchorah
Jan 06 2017 00:24
@gbsimon87 What do you do with the difficult parts of your job? How do you manage if you don't know something?
webimdesign
@webimdesign
Jan 06 2017 00:25
@sjames1958gm
function reverseString(str) {
var array = [];
array = str.split(' ');
array.reverse();
var arr = array.join(" ");
return arr;
}
what should i modify?
Stephen James
@sjames1958gm
Jan 06 2017 00:25
@webimdesign use empty string for both split and join
itsthomas
@itsthomas
Jan 06 2017 00:25

When I run this:

var myObject = {
    name: "Richard",
    age: 35,
    gender: "male"
};

for(i in myObject) {
    console.log(myObject[i]);
}

I get this in console:
Richard
35
male
undefined

What is the undefined??

Simon Cordova
@gbsimon87
Jan 06 2017 00:25
@MikeJSchorah honestly I research online.
Nobody knows all of the code anyway.
I was even on FCC asking help on the new HTML5 sliders and how to interact with them, which was a task I needed for a company client.
Stephen James
@sjames1958gm
Jan 06 2017 00:26
@itsthomas undefined is the result of the for loop
webimdesign
@webimdesign
Jan 06 2017 00:26
@sjames1958gm They are empty
Stephen James
@sjames1958gm
Jan 06 2017 00:26
@webimdesign no they are not - they have 1 space which is not the same as empty
itsthomas
@itsthomas
Jan 06 2017 00:26
@sjames1958gm , but why I get it? What is wrong in that code?
Mike
@MikeJSchorah
Jan 06 2017 00:26
@gbisimon Do you use Stack Overflow? I tried using it a year ago, but if you don't get points, they will suspend your account for a few days.
webimdesign
@webimdesign
Jan 06 2017 00:27
@sjames1958gm Oh my god :)) thank you bro :))
CamperBot
@camperbot
Jan 06 2017 00:27
:warning: webimdesign already gave sjames1958gm points
webimdesign sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
Stephen James
@sjames1958gm
Jan 06 2017 00:27
@itsthomas nothing - the console outputs the result of the last expression and the result of for loop is undefined
Addacus
@Addacus
Jan 06 2017 00:27

2
function nextInLine(arr, item) {
3
// Your code here
4
var removed = arr[0];
5
arr.push(item);
6
arr.shift();
7
return removed; // Change this line
8
}
9

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

13
// Display Code
14
console.log("Before: " + JSON.stringify(testArr));
15
console.log(nextInLine(testArr, 6)); // Modify this line to test
16
console.log("After: " + JSON.stringify(testArr));
17
Stephen James
@sjames1958gm
Jan 06 2017 00:27
@webimdesign :+1:
webimdesign
@webimdesign
Jan 06 2017 00:27
I just did't see , I am so blind
@sjames1958gm :))
Addacus
@Addacus
Jan 06 2017 00:27
That looks gross, how do I post a clip of my code like everyone else?
Stephen James
@sjames1958gm
Jan 06 2017 00:27
@Addacus you need to return the first element after the push not before
@Addacus '''
CamperBot
@camperbot
Jan 06 2017 00:27
:bulb: to format code use backticks! ``` more info
eeflores
@eeflores
Jan 06 2017 00:27
@itsthomas even if you do a simple statement like a console.log that doesn't return a value you'll get an undefined
Stephen James
@sjames1958gm
Jan 06 2017 00:27
click that more info link above
itsthomas
@itsthomas
Jan 06 2017 00:28
@sjames1958gm and @eeflores doe’s it mean that what ever I run in I get an undefined in the console at the end of the result?
Addacus
@Addacus
Jan 06 2017 00:28
@sjames1958gm But then wouldn't I be returning the first element of the new array, not the removed?
Stephen James
@sjames1958gm
Jan 06 2017 00:29
@itsthomas I was incorrect - the result of the for loop is the result of last iteration of the for loop.
but console.log returns undefined so that is the result of the for loop
@Addacus which is what you are supposed to do - so that [], 1 will return 1 (push 1 then shift 1)
Addacus
@Addacus
Jan 06 2017 00:32
I am still thoroughly confused
itsthomas
@itsthomas
Jan 06 2017 00:32
Whenever I run console.log(“some text”); the last thing I see in the console is undefined. I still don’t understand why?? :-(
Sam Griffen
@ssgriffen
Jan 06 2017 00:32
Anyone know why my links arent working? http://codepen.io/ssgriffen/pen/VmOKEp
David Halls
@DavidHalls
Jan 06 2017 00:33
can i get some feed back on this please http://codepen.io/Byzgig/full/rWpdKN/
Dan Couper
@DanCouper
Jan 06 2017 00:33
@gbsimon87 PHP is pretty awful, but it was the only option for a very long time, and is available almost everywhere. Python is a much better language; Ruby as well. Node is very widely used, Go is getting there as well. Java/C# still king for enterprise. Knowing any language well will get you a job, because someone who knows one language well can be easily trained to use another language, but there is likely to be a slight bias against PHP for anything serious, probably due to it historically being a very bad language with a low bar to entry (like JS), and WordPress. Note knowing what languages are good for is useful, and lets you focus on what you want to do; Node for small, fast, lightweight apps with high throughput (APIs for example), Python for data stuff, Python/Ruby for midrange apps w/ small teams, Java/C# for heavyweight enterprise stuff, Go for APIs. PHP for agencies (WordPress) and legacy business stuff that businesses can't afford to dump. C/C++ for systems stuff. C++ for games. Then a few things that are useful in different specific ways - Erlang/Elixir for distributed, extremely fault-tolerant programming, Swift for IOS development, Haskell for deeply understanding typed functional stuff, Scala for heavy data stuff, Lua for embedded scripting, Rust as an alternative to C, Bash for general scripting (PowerShell also useful on Windows), and SQL is generally v useful to know. Clojure is nice, and is a Lisp, and it is useful to have an understanding of what Lisp is and how it works.
Addacus
@Addacus
Jan 06 2017 00:34
'''
CamperBot
@camperbot
Jan 06 2017 00:34
:bulb: to format code use backticks! ``` more info
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 00:36
is there a way to do auto closing tags in atom?
Addacus
@Addacus
Jan 06 2017 00:37

function nextInLine(arr, item) {
  // Your code here
  var removed = arr[0];
  arr.push(item);
  arr.shift();
  return removed;  // Change this line
}

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

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
I feel really dumb, because it still looks right to me and I can't figure out what you mean to save my life.
Mike
@MikeJSchorah
Jan 06 2017 00:37
Thanks @gbsimon87
CamperBot
@camperbot
Jan 06 2017 00:37
mikejschorah sends brownie points to @gbsimon87 :sparkles: :thumbsup: :sparkles:
:cookie: 381 | @gbsimon87 |http://www.freecodecamp.com/gbsimon87
David Halls
@DavidHalls
Jan 06 2017 00:38
@Addacus not quite, but close
Jason Luboff
@JLuboff
Jan 06 2017 00:39
@DanCouper Whats your opinion of Visual Basic? I'm working on learning only due to the fact that we have several built inhouse apps that were written in VB (they link into our SQL servers as well)
Simon Cordova
@gbsimon87
Jan 06 2017 00:39
@DanCouper thank you very very much for such a detailed response, I'm going to actually save that
CamperBot
@camperbot
Jan 06 2017 00:39
gbsimon87 sends brownie points to @dancouper :sparkles: :thumbsup: :sparkles:
:cookie: 435 | @dancouper |http://www.freecodecamp.com/dancouper
Simon Cordova
@gbsimon87
Jan 06 2017 00:39
@MikeJSchorah no worries man :)
Mike
@MikeJSchorah
Jan 06 2017 00:40
Could someone please tell me how to get started on the Roman Numeral Converter? I don't have a clue. I spent 1/2 hour thinking about it
Carlos
@jeancarlospena
Jan 06 2017 00:41
function addTogether(a, b) {
  return a + b;
}
addTogether(2)(3);
i have never dealt with anything like this. how i am supposed to get the values?
Stephen James
@sjames1958gm
Jan 06 2017 00:41
@itsthomas console.log returns undefined
itsthomas
@itsthomas
Jan 06 2017 00:41
@sjames1958gm thanks
CamperBot
@camperbot
Jan 06 2017 00:41
itsthomas sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 00:41
atom is overwhelming me
CamperBot
@camperbot
Jan 06 2017 00:41
:star2: 5189 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Addacus
@Addacus
Jan 06 2017 00:41

function nextInLine(arr, item) {
  // Your code here
  arr.push(item);
  var removed = arr[0];
  arr.shift();
  return removed;  // Change this line
}

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

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
Figured it out, thanks.. I feel stupid, lol
Dan Couper
@DanCouper
Jan 06 2017 00:41
@JLuboff I’ve never used it tbh, I use C# at work which uses the same system underneath, but I don’t know how different it is - the only thing I really know about it is that it’s fairly simple, and is pretty widely used by business analysts to write Excel macros - this alone kinda puts me off even investigating it. Seems extremely business-ey, so I avoid ;)
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 00:41
theres too much too quick
Stephen James
@sjames1958gm
Jan 06 2017 00:42
@carloslocoo When the function is passed only one value (2) it returns a function which gets called with (3)
Jason Luboff
@JLuboff
Jan 06 2017 00:42
@DanCouper I'm guessing you probably don't know how difficult it would be to rework from VB to c# then?
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 00:42
@MikeJSchorah first think to do is to determine how many digits a particular number has
Mike
@MikeJSchorah
Jan 06 2017 00:43
Thanks @HeebieGeeBee
Carlos
@jeancarlospena
Jan 06 2017 00:43
@sjames1958gm i undestand that but in the "Arguments Optional" challenge that's how they insert it.
CamperBot
@camperbot
Jan 06 2017 00:43
mikejschorah sends brownie points to @heebiegeebee :sparkles: :thumbsup: :sparkles:
:warning: mikejschorah already gave heebiegeebee points
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 00:43
then convert all the thousend digits if it has any, then convert the hundred digits if it has any and so on
Stephen James
@sjames1958gm
Jan 06 2017 00:43
@MikeJSchorah What I did was take a given decimal number and went through the process of converting it by hand to a roman number
Mike
@MikeJSchorah
Jan 06 2017 00:43
Thanks @sjames1958gm
CamperBot
@camperbot
Jan 06 2017 00:43
mikejschorah sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:warning: mikejschorah already gave sjames1958gm points
Mike
@MikeJSchorah
Jan 06 2017 00:44
I ran out of points to give, I am a loser
Stephen James
@sjames1958gm
Jan 06 2017 00:44
@Addacus BTW - return arr.shift() would have done the same
Simon Cordova
@gbsimon87
Jan 06 2017 00:44
@DanCouper @sjames1958gm thanks guys, seems like I'll be starting with PHP
CamperBot
@camperbot
Jan 06 2017 00:44
gbsimon87 sends brownie points to @dancouper and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:warning: gbsimon87 already gave dancouper points
:warning: gbsimon87 already gave sjames1958gm points
Dan Couper
@DanCouper
Jan 06 2017 00:44
@JLuboff because it uses the same underlying system, I assume you should be able to replace bits piecemeal, and they will still all work together - the syntax is extremely similar, but C# looks a helluva lot more robust overall, but it looks like you can just replace class by class/module by module and the VB & C# should all work together
Stephen James
@sjames1958gm
Jan 06 2017 00:44
@carloslocoo Then I am not sure what you are asking - I thought you mean how do you get (3) in the function
jakobmara
@jakobmara
Jan 06 2017 00:45

function titleCase(str) {
var newWord = str.split(' ');
var check = newWord.length;

for (var i = 0; i < check; i++) {
newWord[i][0] = newWord[i][0].toUpperCase;
var check2 = newWord[i].length;
for (var x = 1; x < check2; x++){
newWord[i][x] = newWord[i][x].toLowerCase;
}
}

return newWord;
}

titleCase("I'm a little tea pot");

'''
CamperBot
@camperbot
Jan 06 2017 00:45
:bulb: to format code use backticks! ``` more info
jakobmara
@jakobmara
Jan 06 2017 00:45
'''
CamperBot
@camperbot
Jan 06 2017 00:45
:bulb: to format code use backticks! ``` more info
jakobmara
@jakobmara
Jan 06 2017 00:45

'''

function titleCase(str) {
var newWord = str.split(' ');
var check = newWord.length;

for (var i = 0; i < check; i++) {
newWord[i][0] = newWord[i][0].toUpperCase;
var check2 = newWord[i].length;
for (var x = 1; x < check2; x++){
newWord[i][x] = newWord[i][x].toLowerCase;
}
}

return newWord;
}

titleCase("I'm a little tea pot");
'''

CamperBot
@camperbot
Jan 06 2017 00:45
:bulb: to format code use backticks! ``` more info
Stephen James
@sjames1958gm
Jan 06 2017 00:45
@jakobmara toUpperCase this is a function - but you are not calling it
@jakobmara use ```
Jason Luboff
@JLuboff
Jan 06 2017 00:45
@DanCouper Thanks. I think I'll try my best at VB, at least so I understand what is going on in the current source code and maybe work my way up to C# :)
CamperBot
@camperbot
Jan 06 2017 00:45
jluboff sends brownie points to @dancouper :sparkles: :thumbsup: :sparkles:
:cookie: 436 | @dancouper |http://www.freecodecamp.com/dancouper
jakobmara
@jakobmara
Jan 06 2017 00:45
ohhh
function titleCase(str) {
  var newWord = str.split(' ');
  var check = newWord.length;

  for (var i = 0; i < check; i++) {
  newWord[i][0] = newWord[i][0].toUpperCase;
  var check2 = newWord[i].length;
    for (var x = 1; x < check2; x++){
      newWord[i][x] = newWord[i][x].toLowerCase;
    }
}

  return newWord;
}

titleCase("I'm a little tea pot");
Carlos
@jeancarlospena
Jan 06 2017 00:46
@sjames1958gm how do i get the function that said it returns?
jakobmara
@jakobmara
Jan 06 2017 00:46
thanks @sjames1958gm
CamperBot
@camperbot
Jan 06 2017 00:46
jakobmara sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 5190 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Jan 06 2017 00:47
@carloslocoo You write the function
  function test() {
     return function () {}
}
Dan Couper
@DanCouper
Jan 06 2017 00:47
@JLuboff I’ve only been using C# for 6 months, it’s honestly not that difficult - it’s built so that new programmers can be trained up in it easily (like Java), what is overwhelming is the sheer size of the language ecosystem more than anything else. The type system catches a lot of issues (it just flat out stops you doing some of the stupid stuff you can do in, for example, JavaScript), and Visual Studio (especially with Resharper) is a pretty excellent (if often jarringly slow) tool
webimdesign
@webimdesign
Jan 06 2017 00:47
@sjames1958gm Hei : Return true if the given string is a palindrome. Otherwise, return false.

function palindrome(str) {
// Good luck!

var array = [];
array = str.split("");
array.reverse();
var arr = array.join("");
var palindrom = arr;
palindrom.toLowerCase();
var newstr = palindrom.replace(/ _!@#$%^&*()/gi,'');

if(newstr===str){
return true;
}

return false;
}

palindrome("eye");

Is working, but it need to be working for thigs like : _eye and eye @sjames1958gm
to ignore _%#@!#@!*#! caracters
babajide odusola
@cesarecaravaggio
Jan 06 2017 00:49
guys whats going on with my code?
var myArray = [["John", 23], ["dog", 3]];
myArray.shift();
myArray.unshift(["paul", 35]);
is it the parenthesis
Jason Luboff
@JLuboff
Jan 06 2017 00:50
@DanCouper Well I'm still relatively new to programming in and of itself. I started FCC about 6 months ago. I'm up to the Pomodoro clock and only haven't finished that due to a project I built for work (Digital conference room sign). However, while I'm starting to get more intune and understanding better...I feel there is still a hell of a lot I'm not understanding haha. I'm working on finding other sources (books) to read up on and get a better understanding of the Javascript ecosystem and at the same time, VB (and SQL)...and eventually whatever other programs I'd feel are useful.
@cesarecaravaggio I'm guessing that Paul should be capitialized
Stephen James
@sjames1958gm
Jan 06 2017 00:51
@webimdesign Maybe remove all the special characters and toLowerCase before you split/join
@cesarecaravaggio The code wants Paul
jakobmara
@jakobmara
Jan 06 2017 00:52
try this @cesarecaravaggio myArray.unshift(["Paul", 35]);
Dan Couper
@DanCouper
Jan 06 2017 00:53
@JLuboff Just whatever language is good I think - JS, VB and SQL gives a pretty nice basis, and the more you learn of each will feed into you learning the others. And it’s always really painful at first :). Just the fact you’re building actual real things is a massive, massive thing because it forces you to learn quickly. And once you know any of them well, learning other languages gets exponentially easier
jakobmara
@jakobmara
Jan 06 2017 00:53
tell me if that works if so I know the problem
babajide odusola
@cesarecaravaggio
Jan 06 2017 00:53
@JLuboff @sjames1958gm right thanks for the correction guys!
CamperBot
@camperbot
Jan 06 2017 00:53
cesarecaravaggio sends brownie points to @jluboff and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:cookie: 575 | @jluboff |http://www.freecodecamp.com/jluboff
:star2: 5191 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
babajide odusola
@cesarecaravaggio
Jan 06 2017 00:53
@jakobmara yeah i got that aha didnt look hard enough i guess.
Jason Luboff
@JLuboff
Jan 06 2017 00:54
@DanCouper Exactly. I'm going to keep on going....keep on learning...and just keep doing my best! The pain will eventually subside haha
webimdesign
@webimdesign
Jan 06 2017 00:54
@sjames1958gm It is still not working
Dan Couper
@DanCouper
Jan 06 2017 00:56
@JLuboff Then you’ll use another language, and be like "why the hell was I using JS/VB for so long! This new language fixes all of the problems I had in those other languages"…and then the cycle will continue
Jason Luboff
@JLuboff
Jan 06 2017 00:58
:laughing: I look forward to it. And on that note, I am out for the evening. See everybody tomorrow
Simon Cordova
@gbsimon87
Jan 06 2017 00:59
Off to bed, night guys...
brunoallenbjj
@brunoallenbjj
Jan 06 2017 01:01
Variable myStr should contain the string: I am a "double quoted" string inside "double quotes". my , code is : var myStr= "I am a \"double quoted\" string inside \"double quotes\"";
where is the problem
??
uriznik
@uriznik
Jan 06 2017 01:01
@brunoallenbjj missing full stop at the end?
brunoallenbjj
@brunoallenbjj
Jan 06 2017 01:03
it is complete ..
brunoallenbjj
@brunoallenbjj
Jan 06 2017 01:08
@uriznik thanks bro
CamperBot
@camperbot
Jan 06 2017 01:08
:cookie: 444 | @uriznik |http://www.freecodecamp.com/uriznik
brunoallenbjj sends brownie points to @uriznik :sparkles: :thumbsup: :sparkles:
Stephen James
@sjames1958gm
Jan 06 2017 01:22
@webimdesign Sorry was off line for a bit, where are you now
webimdesign
@webimdesign
Jan 06 2017 01:23

@sjames1958gm Return the provided string with the first letter of each word capitalized. Make sure the rest of the word is in lower case.

For the purpose of this exercise, you should also capitalize connecting words like "the" and "of".

Sara Dorris
@saralee233
Jan 06 2017 01:25
not quite sure of how to declare the local variable myVar inside myLocalScope
function myLocalScope() {
  'use strict';
  var loc = "myVar";

  console.log(loc);
}
myLocalScope();

// Run and check the console
// myVar is not defined outside of myLocalScope
console.log(loc); // "undefined"

// Now remove the console log line to pass the test
Johnny
@JohnnyBizzel
Jan 06 2017 01:26

@saralee233

function myLocalScope() {
  'use strict';
  var myVar = 0;

  console.log(myVar);
}
myLocalScope();

Maybe like this?

Victor Rose
@vicdrose
Jan 06 2017 01:27
man this is awesome but also difficult
to do in spare time, you need to really dedicate time. How have some of you gotten through FCC
Johnny
@JohnnyBizzel
Jan 06 2017 01:27
@vicdrose That's the fun :exclamation:
Victor Rose
@vicdrose
Jan 06 2017 01:28
any time management tips?
Johnny
@JohnnyBizzel
Jan 06 2017 01:28
@vicdrose Do a little every day if you can.
Victor Rose
@vicdrose
Jan 06 2017 01:28
gotcha
What's your background? What do you do?
Johnny
@JohnnyBizzel
Jan 06 2017 01:28
@vicdrose And pair programming works for me

What's your background? What do you do?

Who me?

Sara Dorris
@saralee233
Jan 06 2017 01:29
@JohnnyBizzel thanks! how did you know to set myVar = to 0?
CamperBot
@camperbot
Jan 06 2017 01:29
saralee233 sends brownie points to @johnnybizzel :sparkles: :thumbsup: :sparkles:
:star2: 1097 | @johnnybizzel |http://www.freecodecamp.com/johnnybizzel
Victor Rose
@vicdrose
Jan 06 2017 01:29
@JohnnyBizzel yea
Stephen James
@sjames1958gm
Jan 06 2017 01:29
@webimdesign toLowerCase the string break into words then process each word
Johnny
@JohnnyBizzel
Jan 06 2017 01:29
@saralee233 Guess. I don't think it matters. What matters is the scope of where it is.
Victor Rose
@vicdrose
Jan 06 2017 01:29
@JohnnyBizzel that a good suggestion, I could try to get a partner
webimdesign
@webimdesign
Jan 06 2017 01:29
@sjames1958gm I know but i don't get it
Johnny
@JohnnyBizzel
Jan 06 2017 01:30
@vicdrose Ex Software Developer - C#. Now full time studying on FCC.
Stephen James
@sjames1958gm
Jan 06 2017 01:30
@webimdesign Take it step by step -
Johnny
@JohnnyBizzel
Jan 06 2017 01:30
@saralee233 The variable is only available inside it's own function. This is "scope".
@vicdrose The forum is good, plus the LetsPair room.
@vicdrose Your site has :notes: music! :D
webimdesign
@webimdesign
Jan 06 2017 01:33

@sjames1958gm function titleCase(str) {
var title;
var cuvant;
var bunica=str.split(" ");
for(var i=0;i<bunica.length;i++){
cuvant=bunica[i];
for(var j=0;j<cuvant;j++){
title+=cuvant[j];

}

}
return bunica;
}

not working
Johnny
@JohnnyBizzel
Jan 06 2017 01:34

@webimdesign

 function titleCase(str) {
var title;
var cuvant;
var bunica=str.split(" ");
for(var i=0;i<bunica.length;i++){
cuvant=bunica[i];
for(var j=0;j<cuvant;j++){
title+=cuvant[j];
}
}
return bunica;
}

formatted for you.
Does Title Case Mean Like This?

Carlos
@jeancarlospena
Jan 06 2017 01:34
what do you guys prefer list or listless nav?
webimdesign
@webimdesign
Jan 06 2017 01:34
@JohnnyBizzel how can I send like you did? in this format?
Johnny
@JohnnyBizzel
Jan 06 2017 01:34
'''
CamperBot
@camperbot
Jan 06 2017 01:34
:bulb: to format code use backticks! ``` more info
Johnny
@JohnnyBizzel
Jan 06 2017 01:35
^^ see here
Keep ticks code and closing ticks on separate lines
Doegena Fennich
@Doegena
Jan 06 2017 01:35
Gonna go back to Teamtreehouse to take the js course and build some random projects, hopefully after a while i can rush through the rest of the Js challenges, getting stuck to often.
Carlos
@jeancarlospena
Jan 06 2017 01:36
it's not ' it's `, the one with ~
Johnny
@JohnnyBizzel
Jan 06 2017 01:36
@carloslocoo Depends which type of keyboard you are using.
Mind is next to 1
webimdesign
@webimdesign
Jan 06 2017 01:37
@JohnnyBizzel
@JohnnyBizzel thanks
CamperBot
@camperbot
Jan 06 2017 01:37
webimdesign sends brownie points to @johnnybizzel :sparkles: :thumbsup: :sparkles:
Sara Dorris
@saralee233
Jan 06 2017 01:37
when looking at a code how can you differentiate between a global and local variable
CamperBot
@camperbot
Jan 06 2017 01:37
:star2: 1099 | @johnnybizzel |http://www.freecodecamp.com/johnnybizzel
Johnny
@JohnnyBizzel
Jan 06 2017 01:37
@webimdesign Anytime ;)
@saralee233 Global vars are normally placed at the top of a code block.
Also they are not inside a function call.
webimdesign
@webimdesign
Jan 06 2017 01:38
 console.log("Thanks");
agustashd
@agustashd
Jan 06 2017 01:38
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"] } ]; var a = contacts[0]["firstName"]; //return Akira var b = contacts[0].hasOwnProperty("Akira"); //return false var c = contacts.hasOwnProperty("Akira"); //return false
How can i correct the syntax in order to get a true statement out of .hasOwnProperty() variables b and c are what i think is correct but i'm getting false instead
Johnny
@JohnnyBizzel
Jan 06 2017 01:38
@agustashd
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"] } ]; 
var a = contacts[0]["firstName"]; 
//return Akira 
var b = contacts[0].hasOwnProperty("Akira"); 
//return false 
var c = contacts.hasOwnProperty("Akira"); 
//return false
webimdesign
@webimdesign
Jan 06 2017 01:38
@sjames1958gm could you help?
agustashd
@agustashd
Jan 06 2017 01:38
How can i fix that so it displays correctly?
Sara Dorris
@saralee233
Jan 06 2017 01:39
@JohnnyBizzel thanks again!
CamperBot
@camperbot
Jan 06 2017 01:39
saralee233 sends brownie points to @johnnybizzel :sparkles: :thumbsup: :sparkles:
:warning: saralee233 already gave johnnybizzel points
Johnny
@JohnnyBizzel
Jan 06 2017 01:39
@saralee233 ;) You will see the difference easily with practice.
Global vars are not used so much.
agustashd
@agustashd
Jan 06 2017 01:42
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"]
    }
];
var a = contacts[0]["firstName"];
var b = contacts[0].hasOwnProperty("Akira");
var c = contacts.hasOwnProperty("Akira");
webimdesign
@webimdesign
Jan 06 2017 01:42

@JohnnyBizzel could you help

function titleCase(str) {
  var title="";
  var cuvant;
  var bunica=str.split(" ");
  for(var i=0;i<bunica.length;i++){
    cuvant=bunica[i];
    title=+cuvant[0];

  }
  return title;
}

titleCase("I'm a little tea pot");

It says i have to create a title with the first letter of every word

agustashd
@agustashd
Jan 06 2017 01:42
How can i correct the syntax in order to get a true statement out of .hasOwnProperty() variables b and c are what i think is correct but i'm getting false instead
what i think could be correct*
Johnny
@JohnnyBizzel
Jan 06 2017 01:43
@webimdesign IS there a uppercase function?
grantknaver
@grantknaver
Jan 06 2017 01:43
why is this not returning the prime numbers. My rational is : i goes through every number up to the argument number; and tests to see if generates 0 when set against a modulus of j. If so it is supposed to push that number to the array named answer. Here is my code.
grantknaver
@grantknaver
Jan 06 2017 01:44
function sumPrimes(num) {
var answer = [];
 for (var i = 1; i <= num; i++){
   for(var j = 1; j <=num; j++){
     if (i > 1 && i % j === 0){
       answer.push(i);
     }
   }
 }
   return answer;
}

sumPrimes(10);
webimdesign
@webimdesign
Jan 06 2017 01:44
@JohnnyBizzel Something like , but , it is correct what i've write?
grantknaver
@grantknaver
Jan 06 2017 01:44
here is the assignment
Johnny
@JohnnyBizzel
Jan 06 2017 01:44
@agustashd var b = contacts[0].hasOwnProperty("Akira"); // "Akira" is a value not a property
Sara Dorris
@saralee233
Jan 06 2017 01:45

// Setup
var outerWear = "T-Shirt";

function myOutfit() {
  // Only change code below this line
  var myOutfit = "sweater";


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

myOutfit();
I'm just struggling with the concept of how to understand how to add a local variable
Johnny
@JohnnyBizzel
Jan 06 2017 01:46
@grantknaver When I googled how to find a Prime number I found this function
function check_prime(a)
{
   var c = 2;
   for ( c = 2 ; c <= a - 1 ; c++ )
   { 
      if ( a % c === 0 )
           return false;
   }
   if ( c === a )
      return true;
}
@saralee233 var outerWear = "T-Shirt"; is a global variable because it is available to all remaining code.
grantknaver
@grantknaver
Jan 06 2017 01:47
you have any idea what is wrong with my code
and thanks that might give me something to go off of
Johnny
@JohnnyBizzel
Jan 06 2017 01:48
@grantknaver run it through pythontutor
agustashd
@agustashd
Jan 06 2017 01:48
@JohnnyBizzel indeed it is, i'll check now if i can solve the challenge
Johnny
@JohnnyBizzel
Jan 06 2017 01:48
@grantknaver You are creating a massive array
Sara Dorris
@saralee233
Jan 06 2017 01:49
@JohnnyBizzel I was close...i just did not look at the details close enough
Johnny
@JohnnyBizzel
Jan 06 2017 01:49
@saralee233 :eyes: :D
grantknaver
@grantknaver
Jan 06 2017 01:50
@JohnnyBizzel Ok how
Johnny
@JohnnyBizzel
Jan 06 2017 01:50
@grantknaver also that array includes non prime numbers
First make an array of Primes with the function I gave you.
(I think I googled that too!)
grantknaver
@grantknaver
Jan 06 2017 01:52
Ok I am going have to think about this thanks
Farah Soltane
@chokolate
Jan 06 2017 01:53
@johnnunns im stuk at the same thing
Johnny
@JohnnyBizzel
Jan 06 2017 01:53
@grantknaver It is a tricky one to test as the big number can create a big array.
grantknaver
@grantknaver
Jan 06 2017 01:54
OK OK ill get this. The tricky ones are where you learn
Sander Berntsen
@sbxn14
Jan 06 2017 01:55
anyone know how I can assign my js for scrolling to the button in the middle of the screen? im a huge newbie when it comes to js and I donno how to do it myself.. http://codepen.io/sbxn14/pen/egmKRr
Johnny
@JohnnyBizzel
Jan 06 2017 01:55
@grantknaver The prime array form (10) should be [2, 3,5,7], sum = 17
Zak
@zaksanderford
Jan 06 2017 01:56
In the Profile Lookup exercise, can the complex object be thought of as an array in an array? So if I match on the firstName can I iterate over the remaining properties associated with that firstName with a loop?
Johnny
@JohnnyBizzel
Jan 06 2017 01:56
@sbxn14 Paralax scroll?
sega1219
@sega1219
Jan 06 2017 01:56

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

function checkObj(checkProp) {
  // Your Code Here
  myObj.hasOwnProperty(checkProp);{
 if (true){

 return checkProp;} else if(false)
  return "Not Found";
  }
}

// Test your code by modifying these values
checkObj("gift");
what is wrong with my code?
Sander Berntsen
@sbxn14
Jan 06 2017 01:57
@JohnnyBizzel I honestly got no clue. im using a code I found on github and it works great for my navbar but I also want it to work with the extra button i added in the middle of my cover.
Sander Berntsen
@sbxn14
Jan 06 2017 01:57
@JohnnyBizzel ```
Joseph
@revisualize
Jan 06 2017 01:57
@sega1219 true is always true
Sander Berntsen
@sbxn14
Jan 06 2017 01:57
$(document).ready(function() {
  $('.nav a').on('click', function(e) {
    e.preventDefault();

    var target = $(this).attr('href'),
      offset = $(target).offset().top - 70;

    $('html, body').stop().animate({
      scrollTop: offset
    }, 500);
  });
$('.scroll ul li').click(function(e) {
  var $this = $(this);
  var prev = $(this).parent().find('.active');
  prev.removeClass('active');
  if (!$this.hasClass('active')) {
    $this.addClass('active');
  }
  e.preventDefault();
});
});
thats my current code.
how do I modify it so that it picks up the button aswell
sega1219
@sega1219
Jan 06 2017 01:58
@revisualize thank you
CamperBot
@camperbot
Jan 06 2017 01:58
:star2: 2855 | @revisualize |http://www.freecodecamp.com/revisualize
Sander Berntsen
@sbxn14
Jan 06 2017 01:58
thats my button
CamperBot
@camperbot
Jan 06 2017 01:58
sega1219 sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
Sander Berntsen
@sbxn14
Jan 06 2017 01:58
 <a href="#about" class="btn btn-circle page-scroll">
        <i class="fa fa-angle-double-down animated"></i>
      </a>
Johnny
@JohnnyBizzel
Jan 06 2017 01:58
@sega1219 if (true) // always true!
Carlos
@jeancarlospena
Jan 06 2017 01:58
function addTogether() {
  var args = Array.from(arguments);
  return args.some(n => typeof n !== 'number') ? 
    undefined: 
    args.length > 1 ?
      args.reduce((acc, n) => acc += n, 0):
      (n) => typeof n === "number" ? 
        n + args[0]:
        undefined;
}
addTogether(2,3);
is anyone here advanced enough to understand the code above?
Joseph
@revisualize
Jan 06 2017 01:59
@carloslocoo Research Currying.
Sander Berntsen
@sbxn14
Jan 06 2017 01:59
I love curry
Johnny
@JohnnyBizzel
Jan 06 2017 01:59
@revisualize I like a good curry :yum:
Sander Berntsen
@sbxn14
Jan 06 2017 01:59
but can you help ? with the info i gave? @JohnnyBizzel
Johnny
@JohnnyBizzel
Jan 06 2017 02:00
@sbxn14 So you don't want a Parallax scroll? :/
Sander Berntsen
@sbxn14
Jan 06 2017 02:00
@JohnnyBizzel uh no I just want it to have the same scroll effect as i have on the navbar
NEHA MITTOOR CHANGAPPA
@nehamchangappa
Jan 06 2017 02:00
var gloveBoxContents = myStorage.inside["glove box"];
Sander Berntsen
@sbxn14
Jan 06 2017 02:00
but I dont know hwo to connect it
Joseph
@revisualize
Jan 06 2017 02:00
@nehamchangappa You're missing the car
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:00
@sbxn14 do you realise youre using a picture thats almost 13mb as a header?
NEHA MITTOOR CHANGAPPA
@nehamchangappa
Jan 06 2017 02:01
@revisualize thanks
CamperBot
@camperbot
Jan 06 2017 02:01
nehamchangappa sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 2856 | @revisualize |http://www.freecodecamp.com/revisualize
Sander Berntsen
@sbxn14
Jan 06 2017 02:01
@HeebieGeeBee is that bad?
Fernando
@fer408
Jan 06 2017 02:01

i am having some trouble with this algorithm. I get the test cases from true but not for false.
function mutation(arr) {
var sampleA = arr.slice(0,1);
var sampleB = arr.slice(-1);
if(sampleA.indexOf(sampleA.length) == sampleB.indexOf(sampleB.length)) {
return true;
}
else
{
return false;
}

}

HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:01
yes, very
sega1219
@sega1219
Jan 06 2017 02:01
how would I have only the value of a property returned?
Sander Berntsen
@sbxn14
Jan 06 2017 02:01
@HeebieGeeBee how do i make it smaller
Joseph
@revisualize
Jan 06 2017 02:01
@sega1219 How do you access an object property?
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:01
you need to lower the quality
Sander Berntsen
@sbxn14
Jan 06 2017 02:02
but but I just finally got the picture to work after 3 hours :(
sega1219
@sega1219
Jan 06 2017 02:02
@revisualize I need to return its value not the property itself
Zak
@zaksanderford
Jan 06 2017 02:02
@revisualize In the profile look up exercise, is the complex object an array that you apply the coordinate principal to (ie [i][j]) or should I be looking at a different way to access the other properties once I've found a firstName?
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:02
took me almost that long to see it @sbxn14 ;P
Joseph
@revisualize
Jan 06 2017 02:02
@sega1219 Correct.
Sander Berntsen
@sbxn14
Jan 06 2017 02:03
@HeebieGeeBee oh thats why its bad.
Joseph
@revisualize
Jan 06 2017 02:03
@zaksanderford Let's say we have an array:
var contacts = [ "A" , "H" , "S" , "K" ];
How do you access "H"?
Sander Berntsen
@sbxn14
Jan 06 2017 02:03
alright ill lower the quality somehow.
no clue how but ill find otu how
but i I first want to get this button to work D:
Farah Soltane
@chokolate
Jan 06 2017 02:03
@johnnunns what's the logic behind: contacts[i].hasOwnProperty(prop) why you don't need to use contacts[i].hasOwnProperty===prop
Zak
@zaksanderford
Jan 06 2017 02:04
contacts[1]
agustashd
@agustashd
Jan 06 2017 02:04
@revisualize contacts[1] i think
Joseph
@revisualize
Jan 06 2017 02:04

@zaksanderford Let's say you have an object.

// var name = "Happy";
var myFriend = {
        "firstName": "Happy",
        "lastName": "Feet",
        "number": "-i",
        "likes": ["rhythm", "dancing", "soul"]
    }

How do you access the "firstName" of myFriend?

agustashd
@agustashd
Jan 06 2017 02:04
myFriend.firstName
Joseph
@revisualize
Jan 06 2017 02:05
@agustashd I am trying to help someone.
grantknaver
@grantknaver
Jan 06 2017 02:05
@JohnnyBizzel quick question...
Joseph
@revisualize
Jan 06 2017 02:05
I'll make YOU more bold next time.
Sorry about that.
Zak
@zaksanderford
Jan 06 2017 02:05
@revisualize myFriend.firstName
agustashd
@agustashd
Jan 06 2017 02:05
@JohnnyBizzel oh sorry lol
Joseph
@revisualize
Jan 06 2017 02:05

@zaksanderford Let's say we have an array:

var contacts = [ { f: "A" } , { f: "H" } , { f: "S" } , { f: "K" } ];

How do you output "H"?

grantknaver
@grantknaver
Jan 06 2017 02:05
in c = 2 ; c <= a - 1 ; c++ why do you have to take away the 1?
Fernando
@fer408
Jan 06 2017 02:06

i am having some trouble with this algorithm. I get the test cases from true but not for false.
function mutation(arr) {
var sampleA = arr.slice(0,1);
var sampleB = arr.slice(-1);
if(sampleA.indexOf(sampleA.length) == sampleB.indexOf(sampleB.length)) {
return true;
}
else
{
return false;
}

}

He Liu
@HeLiu
Jan 06 2017 02:06
how can i remove a key from an object without have to reassign it to a new object?
Zak
@zaksanderford
Jan 06 2017 02:06
@revisualize ```return contacts1
Joseph
@revisualize
Jan 06 2017 02:07
@zaksanderford Incorrect.
eeflores
@eeflores
Jan 06 2017 02:07
partial credit
Johnny
@JohnnyBizzel
Jan 06 2017 02:07
@grantknaver So you don't go over the size of the array
eeflores
@eeflores
Jan 06 2017 02:07
@zaksanderford do console.log(contacts[1]);
grantknaver
@grantknaver
Jan 06 2017 02:08
how does that prevent it
He Liu
@HeLiu
Jan 06 2017 02:08

Write a function called "removeStringValues".

Given an object, "removeStringValues" removes any properties on the given object whose values are strings.

var obj = {
name: 'Sam',
age: 20
}
removeStringValues(obj);
console.log(obj); // { age: 20 }

var obj = {
  name: 'Sam',
  age: 20
}
var newObj = {};
function removeStringValues(obj) {
  for(var key in obj){
      if(typeof obj[key] !== "string"){
          newObj= obj[key];
      }
  }
  return newObj;
} 

removeStringValues(obj);
grantknaver
@grantknaver
Jan 06 2017 02:08
wouldn't you just want to check up to the argument number
Joseph
@revisualize
Jan 06 2017 02:08
@eeflores That would still be incorrect.
Johnny
@JohnnyBizzel
Jan 06 2017 02:08
@sbxn14 Sorry, it's a bit to complicated to work out.
eeflores
@eeflores
Jan 06 2017 02:08
@revisualize but it's a hint
Sander Berntsen
@sbxn14
Jan 06 2017 02:09
@JohnnyBizzel okay.. ill just post it on stackoverflow
Yonatan Rojas
@MajorTom250993
Jan 06 2017 02:10
@Manish-Giri @Lumexralph Thank you for the advice! the code runs good :smile:
CamperBot
@camperbot
Jan 06 2017 02:10
majortom250993 sends brownie points to @manish-giri and @lumexralph :sparkles: :thumbsup: :sparkles:
:cookie: 662 | @lumexralph |http://www.freecodecamp.com/lumexralph
:star2: 3583 | @manish-giri |http://www.freecodecamp.com/manish-giri
thereal-bond
@thereal-bond
Jan 06 2017 02:12
Hey guys, looking for help with the Find the Longest Word in a String challenge
I believe I'm close, but I'm stuck.
grantknaver
@grantknaver
Jan 06 2017 02:12
and for that matter why use the modulus to rule out prime instead of the main identifier
sega1219
@sega1219
Jan 06 2017 02:12
@revisualize I'm asking how do I only access only a property's value
thereal-bond
@thereal-bond
Jan 06 2017 02:13
function findLongestWord(str) {
  var array = str.split(" ");

  array.sort(function sort (a,b)  {
    return b.length - a.length;
  });
   {
   array[0]=str;
     return str.length;
  }

}

findLongestWord("The quick brown fox jumped over the lazy dog");
grantknaver
@grantknaver
Jan 06 2017 02:13
@JohnnyBizzel sorry for 20 questions. Just trying to figure this out
Joseph
@revisualize
Jan 06 2017 02:13

Here is the question that I asked:

@sega1219 How do you access an object property?

Here is a link to how you could answer that question:
@sega1219 Accessing Objects Properties with Bracket Notation https://www.freecodecamp.com/challenges/accessing-objects-properties-with-bracket-notation

sega1219
@sega1219
Jan 06 2017 02:13
@revisualize thank you
CamperBot
@camperbot
Jan 06 2017 02:13
sega1219 sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:warning: sega1219 already gave revisualize points
Joseph
@revisualize
Jan 06 2017 02:15
@sega1219 I asked my question very specifically as to relate it back to the map and what you learned before.
Zak
@zaksanderford
Jan 06 2017 02:17
@revisualize contacts[1].f
Joseph
@revisualize
Jan 06 2017 02:17
@zaksanderford YES.
NEHA MITTOOR CHANGAPPA
@nehamchangappa
Jan 06 2017 02:17
for (var i=0; i < arr.length; i++) {
for (var j=0; j < arr[i].length; j++)
for(var k=0; k<arr[i].length; k++){
product=product*arr[i][j][k];
}
}
Joseph
@revisualize
Jan 06 2017 02:17
@zaksanderford So, going back to your question.
@zaksanderford Where is the [i][j]?
cubancigaro
@cubancigaro
Jan 06 2017 02:17
ok need help with generate random fractions with javascript
Zak
@zaksanderford
Jan 06 2017 02:18
[1][0]
Joseph
@revisualize
Jan 06 2017 02:18
@zaksanderford Hint: There isn't a j needed.
No.
There is no second array.
Look at your array of objects.
NEHA MITTOOR CHANGAPPA
@nehamchangappa
Jan 06 2017 02:18
can some one help me by debugging where i have done wrong in this following code :
for (var i=0; i < arr.length; i++) {
for (var j=0; j < arr[i].length; j++)
for(var k=0; k<arr[i].length; k++){
product=product*arr[i][j][k];
}
}
Joseph
@revisualize
Jan 06 2017 02:19
@nehamchangappa Too far. Remove the for for the k
Anyhow.
It is 620pm PST.
I am going HOME.
:v:
Zak
@zaksanderford
Jan 06 2017 02:20
thanks @revisualize
CamperBot
@camperbot
Jan 06 2017 02:20
zaksanderford sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 2857 | @revisualize |http://www.freecodecamp.com/revisualize
Zak
@zaksanderford
Jan 06 2017 02:20
@revisualize travel safe
Joseph
@revisualize
Jan 06 2017 02:21
@zaksanderford Hopefully, my series of questions helped.
Carlos
@jeancarlospena
Jan 06 2017 02:21
@nehamchangappa forgot one closing }
NEHA MITTOOR CHANGAPPA
@nehamchangappa
Jan 06 2017 02:21
thanks @revisualize
CamperBot
@camperbot
Jan 06 2017 02:21
nehamchangappa sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:warning: nehamchangappa already gave revisualize points
NEHA MITTOOR CHANGAPPA
@nehamchangappa
Jan 06 2017 02:21
@carloslocoo where did i forget it ?
Joseph
@revisualize
Jan 06 2017 02:22
@carloslocoo She didn't if she removes the for line for that k stuff like I said.
Carlos
@jeancarlospena
Jan 06 2017 02:22
@nehamchangappa the middle for loop does not have closing or opening braces{}
NEHA MITTOOR CHANGAPPA
@nehamchangappa
Jan 06 2017 02:23
@carloslocoo yaa got it ! thanks
CamperBot
@camperbot
Jan 06 2017 02:23
nehamchangappa sends brownie points to @carloslocoo :sparkles: :thumbsup: :sparkles:
:cookie: 293 | @carloslocoo |http://www.freecodecamp.com/carloslocoo
Carlos
@jeancarlospena
Jan 06 2017 02:24
how do i check how many cookies i have?
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:25
well it says it there
Omer Tarik Koc
@omertarik96
Jan 06 2017 02:25

Hello, I am trying to solve lookup profile challenge. I did write that code

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

  }

  if (firstName === contacts[firstName] && prop === contacts[prop]) {
    return contacts[prop];
  }



}

What am I missing?

HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:26
why are you returning contact[i}
and not using it for your if statement
not using the loop*
Omer Tarik Koc
@omertarik96
Jan 06 2017 02:27
@HeebieGeeBee Yes, u r right. I should use it
justinbarr00
@justinbarr00
Jan 06 2017 02:28
How do you comment code that looks like it is still in the console?
Randall Wyatt
@RandallWy
Jan 06 2017 02:28
Can someone help me with Java? not JS. there really isnt a room for java
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:28
''' @justinbarr00
Mike
@MikeJSchorah
Jan 06 2017 02:29
@RandallWy There is, but no one is on it. I can help if it's basic Java
justinbarr00
@justinbarr00
Jan 06 2017 02:29
@HeebieGeeBee Thanks
CamperBot
@camperbot
Jan 06 2017 02:29
justinbarr00 sends brownie points to @heebiegeebee :sparkles: :thumbsup: :sparkles:
:cookie: 450 | @heebiegeebee |http://www.freecodecamp.com/heebiegeebee
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:29
no wait
its backticks
'''
CamperBot
@camperbot
Jan 06 2017 02:29
:bulb: to format code use backticks! ``` more info
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:29
there it is
click that more info
@justinbarr00
justinbarr00
@justinbarr00
Jan 06 2017 02:30
I am having trouble with everything in this if statement running true.

''' function titleCase(str) {

var arr = [];
var strl = str.toLowerCase();

arr = strl.split('');

for (var i = 0 ; i < arr.length ; i++) {
if ( (arr[0]) || (arr[(i - 1)] = " ")) {
arr[i] = arr[i].toUpperCase();
}
else {
arr[i] = arr[i].toLowerCase();
}

}
return arr;
}

titleCase("I'm a little tea pot"); '''

CamperBot
@camperbot
Jan 06 2017 02:30
:bulb: to format code use backticks! ``` more info
justinbarr00
@justinbarr00
Jan 06 2017 02:30
oh wrong ones.
lol
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:30
sorry yeah read the more info thats what i was trying to bring up
Randall Wyatt
@RandallWy
Jan 06 2017 02:30
Sent you a message @MikeJSchorah
EvanK
@Trekev
Jan 06 2017 02:31
Hello all, I was wondering how to print a variable on the freeCodeCamp log so I can use it for debugging
I have tried console.log(var) but it didn't seem to print
Mike
@MikeJSchorah
Jan 06 2017 02:31
@RandallWy I don't know how to check my messages on here. I've tried it before to no avail
justinbarr00
@justinbarr00
Jan 06 2017 02:32
function titleCase(str) {


  var arr = [];
  var strl = str.toLowerCase();

  arr = strl.split('');

  for (var i = 0 ; i < arr.length ; i++) {
    if ( (arr[0]) || (arr[(i - 1)] = " ")) { 
      arr[i] = arr[i].toUpperCase();
      }
    else {
      arr[i] = arr[i].toLowerCase();
    }


  }
 return arr;
}

titleCase("I'm a little tea pot");
Randall Wyatt
@RandallWy
Jan 06 2017 02:32
@MikeJSchorah The thing I need help on is to conver a string to an int. where a=1 and A=2 || z=26 Z=52 for example.
agustashd
@agustashd
Jan 06 2017 02:32
@omertarik96 i just finished that challenge so if you need help just ask
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:32
@justinbarr00 might wanna rethink how youre doing this
grantknaver
@grantknaver
Jan 06 2017 02:32
anyone free to help me with an assignement
Mike
@MikeJSchorah
Jan 06 2017 02:33
@RandallWy I was thinking of basic basic Java. Yeah, that's on a different level for me
I thought you were going to ask me what polymorphism is or something basic like that
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:34
@justinbarr00 why would you not just split the string into an array of single words to start with?
then just go through each word and change the first letter to uppercase
justinbarr00
@justinbarr00
Jan 06 2017 02:35
@HeebieGeeBee Thanks! I was trying that originally but was having some issues with the syntax so i was trying this way. I'll see what I can find on that
CamperBot
@camperbot
Jan 06 2017 02:35
:warning: justinbarr00 already gave heebiegeebee points
justinbarr00 sends brownie points to @heebiegeebee :sparkles: :thumbsup: :sparkles:
Mike
@MikeJSchorah
Jan 06 2017 02:35
@grantknaver If it's basic, shoot. If not, someone else will have to
grantknaver
@grantknaver
Jan 06 2017 02:35
here is the assignment
here is my code...
Mike
@MikeJSchorah
Jan 06 2017 02:36
Yep. It's an algorithm. @HeebieGeeBee is good with those
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:36
huh?
@MikeJSchorah
grantknaver
@grantknaver
Jan 06 2017 02:37
 var answer = [];
 for (var i = 1; i <= num; i++){
   for(var j = 1; j <=num; j++){
     if (i > 1 && i % j > 0 ){
       answer.push(i);
     }
   }
   return answer;
 }
sega1219
@sega1219
Jan 06 2017 02:37
I don't know what's wrong
Mike
@MikeJSchorah
Jan 06 2017 02:37
What's wrong @sega1219 ?
sega1219
@sega1219
Jan 06 2017 02:38

var myMusic = [
  {
    "artist": "Billy Joel",
    "title": "Piano Man",
    "release_year": 1973,
    "formats": [ 
      "CS", 
      "8T", 
      "LP" ],
    "gold": true
  }

  // Add record here
  {"artist":"Sam Smith",
  "title":"Writings on the Wall",
  "release_year":"2015",
  "formats":[
    "CD",
    "Yotube",
    "MP3"

  ]
  }

  ];
Mike
@MikeJSchorah
Jan 06 2017 02:38
@sega1219 What's the exercise?
sega1219
@sega1219
Jan 06 2017 02:38
manipulating complex objects
Manish Giri
@Manish-Giri
Jan 06 2017 02:38
@sega1219 you need the two objects separated by a ,.
Because they are essentially two array elements.
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:39
i > 1 && i % j > 0 @grantknaver is this going to find the prime number?
sega1219
@sega1219
Jan 06 2017 02:39
@Manish-Giri thank you
CamperBot
@camperbot
Jan 06 2017 02:39
sega1219 sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 3584 | @manish-giri |http://www.freecodecamp.com/manish-giri
Manish Giri
@Manish-Giri
Jan 06 2017 02:39
@sega1219 welcome
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:40
also @grantknaver it asks yu to sum the prime numbers too
grantknaver
@grantknaver
Jan 06 2017 02:40
@HeebieGeeBee I understand the sum part, but first I have to obtain the primes
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:41
yeah
grantknaver
@grantknaver
Jan 06 2017 02:41
and ya it is supposed to find the primes
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:41
do you think it will?
grantknaver
@grantknaver
Jan 06 2017 02:42
well its not so Im guessing not
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:42
i > 1 && i % j > 0 go through this and do this with just a couple of numbers
say i is 8
then you loop through asking to push i into an array if the remainder of 8 and every number between 1 and 10 is greater than 0
grantknaver
@grantknaver
Jan 06 2017 02:44
hmm
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:44
to me something seems wrong there
grantknaver
@grantknaver
Jan 06 2017 02:46
because it is
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:47
as a hint
a prime number always has a remainder if you try and divide it by 2
grantknaver
@grantknaver
Jan 06 2017 02:48
ah that explains it
ok ok
but what about 2, which is prime
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:49
well thats an exception isnt it
grantknaver
@grantknaver
Jan 06 2017 02:49
ya
gotcha how about this than
sega1219
@sega1219
Jan 06 2017 02:53
I'm having issues on Testing objects for properties . Would I use an else if statement at all?
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:53
usually @sega1219
well
an if statement at least
grantknaver
@grantknaver
Jan 06 2017 02:53
lol
im trying something one sec
Mike
@MikeJSchorah
Jan 06 2017 02:54
@sega1219 You need to use the .hasOwnProperty method
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:54
dont overcomplicate it @grantknaver
sega1219
@sega1219
Jan 06 2017 02:54
@MikeJSchorah
Mike
@MikeJSchorah
Jan 06 2017 02:54
@sega1219 Check to see if myObj has checkProp in an if statement
Diego Mayer
@Chrono79
Jan 06 2017 02:55
@sega1219 yes, you need to use an if (not else if)
grantknaver
@grantknaver
Jan 06 2017 02:55
 var answer = [2,];
 var i = 2;
 for (i = 2; i <= num - 1; i++) {
    if (num % i === 0 ){

    }else {
      answer.push(i);  
    }
 }
  return answer;
}
sega1219
@sega1219
Jan 06 2017 02:55
 var value=myObj.checkProp;
  myObj.hasOwnProperty(checkProp);
 if (true){
   return value;
 }else if (false){
  return "Not Found";}
}
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:55
@grantknaver no
grantknaver
@grantknaver
Jan 06 2017 02:55
well ok
Diego Mayer
@Chrono79
Jan 06 2017 02:56
@sega1219 that won't work (for several reasons)
Mike
@MikeJSchorah
Jan 06 2017 02:56
myObj.hasOwnProperty(checkProp);
Put this inside of your if statement
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:56
your loop wants to be iterating through all the numbers upto num
@grantknaver
sega1219
@sega1219
Jan 06 2017 02:56
thank you @MikeJSchorah
CamperBot
@camperbot
Jan 06 2017 02:56
sega1219 sends brownie points to @mikejschorah :sparkles: :thumbsup: :sparkles:
:cookie: 282 | @mikejschorah |http://www.freecodecamp.com/mikejschorah
sega1219
@sega1219
Jan 06 2017 02:56
thank you @Chrono79
CamperBot
@camperbot
Jan 06 2017 02:56
sega1219 sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 3064 | @chrono79 |http://www.freecodecamp.com/chrono79
grantknaver
@grantknaver
Jan 06 2017 02:57
 var answer = [2,];
 var i = 2;
 for (i = 2; i <= num; i++) {
    if (num % i === 0 ){

    }else {
      answer.push(i);  
    }
 }
  return answer;
}
Mike
@MikeJSchorah
Jan 06 2017 02:57
@sega1219 myObj should be the variable too, not value
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:58
why num % i?
Diego Mayer
@Chrono79
Jan 06 2017 02:58
@sega1219
 if (true){ //true is always true (no surprise there)
   return value;
 }else if (false){ // this if is never reached and false is never true, so even if the first condition wasn't true, it'll never enter this if
  return "Not Found";}
}
grantknaver
@grantknaver
Jan 06 2017 02:58
if num % i equals zero than it is not an prime because prime has a remainder
with the exception of 2 which is already in the array
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 02:59
hmmm
grantknaver
@grantknaver
Jan 06 2017 03:00
idk man I am competely confused
this tough been on it forever
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:01
why not if (i%2 != 0) answer.push[i]
Dylan Hsiao
@greedylan
Jan 06 2017 03:01
could anyone kindly explain the concept of Boolean Object....been reading the documentation but still can't wrap my head around it
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:01
maybe your way would work i just have to get my head around thinking that way
lol
Mike
@MikeJSchorah
Jan 06 2017 03:02
@greedylan You're basically just testing whether something is true or false. What would you like to know about it?
grantknaver
@grantknaver
Jan 06 2017 03:02
its not and yours is shorter
me try
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:03
i may not have done all the syntax properly there make sure you write the if statement properly
lol
grantknaver
@grantknaver
Jan 06 2017 03:04
that i can do lol
Dylan Hsiao
@greedylan
Jan 06 2017 03:04
@MikeJSchorah If the value is omitted or is 0, -0, null, false, NaN, undefined, or the empty string (""), new Boolean(value) returns false?
grantknaver
@grantknaver
Jan 06 2017 03:04
your basically doing the opposite of what I was doing
sega1219
@sega1219
Jan 06 2017 03:05
if (myObj.hasOwnProperty(checkProp)){
   return myObj;
 }else
  return "Not Found";
}
Mike
@MikeJSchorah
Jan 06 2017 03:06
@greedylan It's just something that you have to accept. That is just what happens because when there is nothing there, it will return false. It's only true if it is in fact true. All other else, it is false.
grantknaver
@grantknaver
Jan 06 2017 03:06
what about 10
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:06
what about 10?
10 isnt a prime number
Manish Giri
@Manish-Giri
Jan 06 2017 03:07
@sega1219 when the property exists, you need to return it's value, not the object itself
grantknaver
@grantknaver
Jan 06 2017 03:07
sorry that is not what I meant
Mike
@MikeJSchorah
Jan 06 2017 03:07
@sega1219 It's looking good. You're almost there. Just remember that you're returning the property that you're checking in the array of myObj in an array format since myObj is an array.
grantknaver
@grantknaver
Jan 06 2017 03:08
it populated 9 and that isnt a prime
Manish Giri
@Manish-Giri
Jan 06 2017 03:08
I thought myObj was an object..
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:08
how?
9%2 = 1
grantknaver
@grantknaver
Jan 06 2017 03:09
shrug yep
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:09
put the code up
grantknaver
@grantknaver
Jan 06 2017 03:09
will do
lol
Mike
@MikeJSchorah
Jan 06 2017 03:09
return myObj[checkProp];
@sega1219 I know what I just said probably sounds confusing, so here is what that line should look like
grantknaver
@grantknaver
Jan 06 2017 03:09
 var answer = [2,];
 var i = 2;
 for (i = 2; i < num; i++) {
    if (i%2 !== 0){
      answer.push(i);  
    }
 }
  return answer;
sega1219
@sega1219
Jan 06 2017 03:10
@MikeJSchorah oh ok thank youso much
CamperBot
@camperbot
Jan 06 2017 03:10
sega1219 sends brownie points to @mikejschorah :sparkles: :thumbsup: :sparkles:
:warning: sega1219 already gave mikejschorah points
sega1219
@sega1219
Jan 06 2017 03:10
@Manish-Giri thank you too
CamperBot
@camperbot
Jan 06 2017 03:10
sega1219 sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:warning: sega1219 already gave manish-giri points
babajide odusola
@cesarecaravaggio
Jan 06 2017 03:11
what does this "+=" do again?
Manish Giri
@Manish-Giri
Jan 06 2017 03:11
@sega1219 welcome
@cesarecaravaggio depends on the context, mostly it adds the value and puts it back in the variable
Mike
@MikeJSchorah
Jan 06 2017 03:12
@cesarecaravaggio It adds something to the variable on the left
Manish Giri
@Manish-Giri
Jan 06 2017 03:12
so x += 5 is the same as x = x + 5
grantknaver
@grantknaver
Jan 06 2017 03:15
its weird isn't it
babajide odusola
@cesarecaravaggio
Jan 06 2017 03:16

thanks guys @Manish-Giri @MikeJSchorah @Chrono79 i actually wanted to know its use here

function fun2() {
  var output = "";
  if (typeof myGlobal != "undefined") {
    output += "myGlobal: " + myGlobal;
  }
  if (typeof oopsGlobal != "undefined") {
    output += " oopsGlobal: " + oopsGlobal;
  }
  console.log(output);
}

i'd take a 1-sentence explanation on what is going on in that code.

CamperBot
@camperbot
Jan 06 2017 03:16
cesarecaravaggio sends brownie points to @manish-giri and @mikejschorah and @chrono79 :sparkles: :thumbsup: :sparkles:
:cookie: 283 | @mikejschorah |http://www.freecodecamp.com/mikejschorah
:star2: 3065 | @chrono79 |http://www.freecodecamp.com/chrono79
:star2: 3585 | @manish-giri |http://www.freecodecamp.com/manish-giri
Diego Mayer
@Chrono79
Jan 06 2017 03:18
@cesarecaravaggio basically what @Manish-Giri and @MikeJSchorah told youm, in this case is string concatenation
function fun2() {
  var output = "";
  if (typeof myGlobal != "undefined") {
    output = "myGlobal: " + myGlobal; //this here could use  = instead
  }
  if (typeof oopsGlobal != "undefined") {
    output += " oopsGlobal: " + oopsGlobal; //this one not, because output here could have already content 
  }
  console.log(output);
}
grantknaver
@grantknaver
Jan 06 2017 03:18
@HeebieGeeBee u still there
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:18
ok i guess i was wrong @grantknaver
i dont get why it pushed 9
grantknaver
@grantknaver
Jan 06 2017 03:19
how? your logic seemed right?
weird......
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:19
i just went and checked back how i didn mine
Creg Antony
@cregantony
Jan 06 2017 03:19
Ok I'm stumped what is wrong with this?
var myStr= "FirstLine \n \SecondLine\ \r Thirdline" ; // Change this line
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:19
i dont know why it pushed 9 but it will miss out some prime numbers when you get further
grantknaver
@grantknaver
Jan 06 2017 03:20
well than dang
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:20
im baffled about that
grantknaver
@grantknaver
Jan 06 2017 03:20
ok lol. Well at least I am not the only one
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:21
but yeah you'll have to create two loops like you did before
sorry
Diego Mayer
@Chrono79
Jan 06 2017 03:21
@cregantony several things
it's ThirdLine
delete all spaces
escape the backslashes around SecondLine
grantknaver
@grantknaver
Jan 06 2017 03:21
ug dang
that made sense, but it wont work
my logic was
you take i and check it against all of j
than you do that with all of i until you are up to the argument number
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:23
it was such a long time ago im guessing i must have tried what i just tried with you the first time and figured it didnt work
grantknaver
@grantknaver
Jan 06 2017 03:24
OK
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:24
yeah that sounds good
grantknaver
@grantknaver
Jan 06 2017 03:25
ill try again
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:25
then if it doesnt divide perfectly with j before i equalling j
grantknaver
@grantknaver
Jan 06 2017 03:26
that is what I am thinking
here I go lets see
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:26
cool
Nathan
@Renown0
Jan 06 2017 03:26
Hey, when someone's not busy, mind helping me clarify something for a challenge?
Joseph
@revisualize
Jan 06 2017 03:27
WRAW!
@Renown0 Which?
Mike
@MikeJSchorah
Jan 06 2017 03:27
Sounds like an angry revisualize, like always LOL
Nathan
@Renown0
Jan 06 2017 03:27
"Record Collection"
A little bit. XD
Joseph
@revisualize
Jan 06 2017 03:28
@Renown0 Whatcha got?
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:28
he musta just eaten or summin
Nathan
@Renown0
Jan 06 2017 03:28
So, this is what it gives us to start:
// Setup
var collection = {
    2548: {
      album: "Slippery When Wet",
      artist: "Bon Jovi",
      tracks: [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
     },
    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) {
  return collection;
}
// Alter values below to test your code
updateRecords(5439, "artist", "ABBA");
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:28
and hes full of energy again
Mike
@MikeJSchorah
Jan 06 2017 03:28
A bunch of chit?
Joseph
@revisualize
Jan 06 2017 03:28
@Renown0 Okay.
They must have changed it.
Nathan
@Renown0
Jan 06 2017 03:29
I'm guessing that to begin with I need to add a few var bits in the given function?
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:29
you not tried anything @Renown0 ?
Joseph
@revisualize
Jan 06 2017 03:29
@Renown0 Nope.
Nathan
@Renown0
Jan 06 2017 03:29
Not yet. Just clarifying what I need to do before I jump in.
Or, rather what I should NOT do apparently. Lol.
Joseph
@revisualize
Jan 06 2017 03:29
@Renown0 You have three variables parameters. Already.
@Renown0 This is where you say: @revisualize What are parameters?
Mike
@MikeJSchorah
Jan 06 2017 03:30
Where is Record Collection? I don't even see it
Joseph
@revisualize
Jan 06 2017 03:30
@MikeJSchorah Advanced Algo.
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:30
yeah why did they move it
Mike
@MikeJSchorah
Jan 06 2017 03:31
Oh. Nevermind. I was going to say I didn't do it yet, but it looks like I did do it and they moved it in the last 6 months
Nathan
@Renown0
Jan 06 2017 03:31
Lol. Well the parameters I believe are in updateRecords(id, prop, value) right?
Joseph
@revisualize
Jan 06 2017 03:31
@HeebieGeeBee Eye Dee Kay
@Renown0 Yes.
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:31
when i saw that pop up again after getting to the advanced algorithms
Joseph
@revisualize
Jan 06 2017 03:31
@Renown0 How do you use parameters in your function?
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:31
i was like what the fuck the pushed me back or summin
Mike
@MikeJSchorah
Jan 06 2017 03:31
@HeebieGeeBee Apparently it was difficult
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:31
but it is exactly the same
Joseph
@revisualize
Jan 06 2017 03:31
@Renown0 just like variables
Mike
@MikeJSchorah
Jan 06 2017 03:32
They're all difficult... time to go get drunk
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:32
nowhere near as difficult as the other advanced challenges
Mike
@MikeJSchorah
Jan 06 2017 03:32
Yeah. I didn't think it stuck out either.
Joseph
@revisualize
Jan 06 2017 03:32
Yeah, It looks like the same challenge.
grantknaver
@grantknaver
Jan 06 2017 03:32
I think I see the issue now
Mike
@MikeJSchorah
Jan 06 2017 03:32
Although I haven't seen it in 6 months
Nathan
@Renown0
Jan 06 2017 03:33
@revisualize Asking me the tough questions now. Lol. I'm probably going to need to go back a little and review what I've learned because something isn't adding up quite right to me.
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:33
what @grantknaver
Joseph
@revisualize
Jan 06 2017 03:33
grantknaver
@grantknaver
Jan 06 2017 03:34
I need a way to isolate only those that solely have only % = 0
Nathan
@Renown0
Jan 06 2017 03:34
Oh shoot. Looks like you've had this question before huh? @revisualize
Or you just keep really good notes.
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:34
post what code you have @grantknaver
you probably just have to break the loop
grantknaver
@grantknaver
Jan 06 2017 03:35
function getSum(total, num) {
    return total + num;
}
 var answer = [2,];
  for (var i = 2; i <= num; i++){
   for(var j = 2; j <=num; j++){
     if (i % j === 0 ){
       answer.push(i);
     }
   }
 }
Joseph
@revisualize
Jan 06 2017 03:35
@Renown0 People come in here ALL time time (before they moved the challenge.
babajide odusola
@cesarecaravaggio
Jan 06 2017 03:35
ok @Chrono79 got it
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:35
not if i & j === 0 push it
grantknaver
@grantknaver
Jan 06 2017 03:36
sorry I left that there
Nathan
@Renown0
Jan 06 2017 03:36
Ah, makes sense. Was it in a different place before? Because I'm still relatively early on to all this JS stuff.
Joseph
@revisualize
Jan 06 2017 03:36
@Renown0 It's now in the Advanced Algos
@Renown0 You can solve it if you just read.
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:37
i == j you push it but if it gets to i%j === 0 you want to break the loop
grantknaver
@grantknaver
Jan 06 2017 03:38
why doesnt i %j === 0 mean it is possibly prime
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:39
becuase it will have been divided equally by a nmber that wasnt itself
grantknaver
@grantknaver
Jan 06 2017 03:40
but j goes up by the same number so technically when i is 5 j is 5
Nathan
@Renown0
Jan 06 2017 03:40
Yup! Working on that now. Thanks @revisualize ! You write good stuff here.
CamperBot
@camperbot
Jan 06 2017 03:40
renown0 sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 2858 | @revisualize |http://www.freecodecamp.com/revisualize
grantknaver
@grantknaver
Jan 06 2017 03:40
wait nvm
wow
nvm
stupid comment
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:40
yeah when i and j reach equal its prime
sorry
Kurt
@recnepstruk
Jan 06 2017 03:41
anyone good with angular?
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:42
how long has angular been out?
that wasnt to say someone here wouldnt be good at it, i was just wondering
babajide odusola
@cesarecaravaggio
Jan 06 2017 03:43
// Declare your variable here
var myGlobal = "global";

function fun1() {
  // Assign 5 to oopsGlobal Here
  oopsGlobal = 5;
}

// Only change code above this line
function fun2() {
  var output = "";
  if (typeof myGlobal != "undefined") {
    output += "myGlobal: " + myGlobal;
  }
  if (typeof oopsGlobal != "undefined") {
    output += " oopsGlobal: " + oopsGlobal;
  }
  console.log(output);
}
How do i assign the number 10 to myGlobal??
Ademola Adegbuyi
@ooade
Jan 06 2017 03:43
@HeebieGeeBee About a year ago
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:43
ahh ok cool ty @ooade
CamperBot
@camperbot
Jan 06 2017 03:43
heebiegeebee sends brownie points to @ooade :sparkles: :thumbsup: :sparkles:
:cookie: 791 | @ooade |http://www.freecodecamp.com/ooade
Joseph
@revisualize
Jan 06 2017 03:44
OMG!
This is my kind of a website.
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:44
that looks complicated @cesarecaravaggio
Joseph
@revisualize
Jan 06 2017 03:44
AHHHH HA HA HA HA!
mitron6
@mitron6
Jan 06 2017 03:44
@cesarecaravaggio myGlobal = 10
Ademola Adegbuyi
@ooade
Jan 06 2017 03:44
@revisualize LOL
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:45
function fun2() {
  var output = "";
  if (typeof myGlobal != "undefined") {
    output += "myGlobal: " + myGlobal;
  }
  if (typeof oopsGlobal != "undefined") {
    output += " oopsGlobal: " + oopsGlobal;
  }
  console.log(output);
}
whats your thinking behind this?
@cesarecaravaggio
babajide odusola
@cesarecaravaggio
Jan 06 2017 03:45
@HeebieGeeBee that'sactually part of the question haha i dint write that.
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:46
oh ok
ok cool then that makes more sense
babajide odusola
@cesarecaravaggio
Jan 06 2017 03:46
yeah im only doing the part before fun2(
Joseph
@revisualize
Jan 06 2017 03:46
DAMN! I wish I would have made this website!
grantknaver
@grantknaver
Jan 06 2017 03:46
@HeebieGeeBee thanks for the help man
CamperBot
@camperbot
Jan 06 2017 03:46
grantknaver sends brownie points to @heebiegeebee :sparkles: :thumbsup: :sparkles:
:cookie: 451 | @heebiegeebee |http://www.freecodecamp.com/heebiegeebee
emr53f
@emr53f
Jan 06 2017 03:47
i'm confused about using reduce to condense arrays. The example code they give is var singleVal = array.reduce(function(previousVal, currentVal) { return previousVal - currentVal; }, 0);
Ademola Adegbuyi
@ooade
Jan 06 2017 03:47
That would be nice tho :sweat_smile:
emr53f
@emr53f
Jan 06 2017 03:47
what is the 0 for?
grantknaver
@grantknaver
Jan 06 2017 03:47
that was a weird way to test but it worked.
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:47
lol not sure how much i was, but hey sometimes realising what we shouldnt do is a good start huh
emr53f
@emr53f
Jan 06 2017 03:47
the explainer doesnt give a reason for the 0, but the function doesnt work without it
mitron6
@mitron6
Jan 06 2017 03:48
@emr53f The zero is the initial value for previousVal.
emr53f
@emr53f
Jan 06 2017 03:49
OHHHHHHHHH
thank you @mitron6 !!
CamperBot
@camperbot
Jan 06 2017 03:49
emr53f sends brownie points to @mitron6 :sparkles: :thumbsup: :sparkles:
:cookie: 432 | @mitron6 |http://www.freecodecamp.com/mitron6
grantknaver
@grantknaver
Jan 06 2017 03:49
lol I knew the double loop was right, but I have to admit I checking to see if i==j and than excluding it as a prime by seeing if j % i == 0 was interesting
Ademola Adegbuyi
@ooade
Jan 06 2017 03:49

@revisualize The best part i like is the quote :smile:

"Good design is as little design as possible."

  • some German motherfucker
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:50
im still wondering how js thinks 9%2 doesnt = 0
Joseph
@revisualize
Jan 06 2017 03:50
hehehe
@HeebieGeeBee Because it doesn't.
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:50
i mean does
Joseph
@revisualize
Jan 06 2017 03:51
What!
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:51
or do i
grantknaver
@grantknaver
Jan 06 2017 03:51
what you talking. stop using logic damnit
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:51
fecking confusing myself now
grantknaver
@grantknaver
Jan 06 2017 03:51
lol
Joseph
@revisualize
Jan 06 2017 03:51
9%2 is 1
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:51
yeah its 1
grantknaver
@grantknaver
Jan 06 2017 03:51
@revisualize no it isnt
Joseph
@revisualize
Jan 06 2017 03:51
YES IT IS!
grantknaver
@grantknaver
Jan 06 2017 03:51
javascript says it is lol
Joseph
@revisualize
Jan 06 2017 03:51

9%2 is 1!

grantknaver
@grantknaver
Jan 06 2017 03:52
@revisualize lol @HeebieGeeBee that was fun
Joseph
@revisualize
Jan 06 2017 03:52
WRAR!
I'm going to watch some youtube.
LOL!
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:52
so why does if (i%2!== 0){ answer.push(i);
does it push 9 when i is 9
Joseph
@revisualize
Jan 06 2017 03:53
Show me more.
Ademola Adegbuyi
@ooade
Jan 06 2017 03:53
Maths says, or some dudes who gave to us that way :smirk:
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:53
ffs
RomingArt
@RomingArt
Jan 06 2017 03:54
Hello I am having trouble with Word Blanks section can someone help please.
Joseph
@revisualize
Jan 06 2017 03:55
[5,6,9,5,33,1,651,2,5,8,978,978,6574,321,9,9,9,9,9,9,9,9,4654,3,7].filter( x => x%2 === 0);
[ 6, 2, 8, 978, 978, 6574, 4654 ]
RomingArt
@RomingArt
Jan 06 2017 03:55
Thank you @revisualize
CamperBot
@camperbot
Jan 06 2017 03:55
romingart sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 2859 | @revisualize |http://www.freecodecamp.com/revisualize
Ademola Adegbuyi
@ooade
Jan 06 2017 03:56
@HeebieGeeBee Based on @revisualize snippet; They'll have one thing in common i.e They are divisible by 2 x % 2 === 0
Joseph
@revisualize
Jan 06 2017 03:57
Remainder:
http://images.tutorvista.com/cms/images/38/remainder1.PNG
13 % 2 is 1 ... 26 % 5 is 1 ... 24 % 6 is 0
24 % 5 is 4 ... 219 % 20 is 19 ... Does that help?
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:57
i know that 9%2 is 1
ffs
i dont have any problems with knowing what a remainder is
Joseph
@revisualize
Jan 06 2017 03:59
I guess I don't see the whole problem.
YOUTUBE!
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 03:59
i trying to figure out where my lgic in the code fecked up
but then its 5am so maybe i should not trying to figure out such things and just realise i did something wrong and not to o it again
Mike
@MikeJSchorah
Jan 06 2017 04:01
5am?
It's 11am here
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 04:02
ooh so that asia?
or russia?
Mike
@MikeJSchorah
Jan 06 2017 04:02
LOL
Yeah. I'm either a Chinese diplomat or a Russian mafia member
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 04:02
no other options
Ademola Adegbuyi
@ooade
Jan 06 2017 04:02
@HeebieGeeBee Wow 5am here too in Africa :sweat_smile:
@HeebieGeeBee Can i take a peak at your code tho?
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 04:03
what code?
Mike
@MikeJSchorah
Jan 06 2017 04:03
Well, I'm going to guess that you're in England @HeebieGeeBee
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 04:03
not quite
Ademola Adegbuyi
@ooade
Jan 06 2017 04:03
@MikeJSchorah Nigeria
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 04:03
im in france
Mike
@MikeJSchorah
Jan 06 2017 04:03
@HeebieGeeBee Ok same area
I was close
But, with me, you're not even close
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 04:03
yeah
so are you in one of the stans?
Mike
@MikeJSchorah
Jan 06 2017 04:04
I'm out in the Pacific Ocean
On a desert island typing away
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 04:04
thats only 6 hours aheadS?
Mike
@MikeJSchorah
Jan 06 2017 04:04
Lol. No, I'm in America
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 04:05
arent you meant to be gehind?
behind
Mike
@MikeJSchorah
Jan 06 2017 04:05
Yeah. 11am is behind
Oops. I meant 11pm
Lol
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 04:05
grrr
sega1219
@sega1219
Jan 06 2017 04:05
what is wrong with my code?

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

// Modify values below to test your code
multiplyAll([[1],[2],[3]]);
Mike
@MikeJSchorah
Jan 06 2017 04:05
I'm so tired
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 04:06
lol
Mike
@MikeJSchorah
Jan 06 2017 04:06
Maybe I should code less
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 04:06
what are your loops doing? @sega1219
sega1219
@sega1219
Jan 06 2017 04:07
oh wait I just saw what I was doing wrong
Q_zheng
@zhengbusinesscontact
Jan 06 2017 04:08
guys, how to remove all non-alphanumeric characters in Js
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 04:08
j*=product not sure if you wanna do this either @sega1219
Q_zheng
@zhengbusinesscontact
Jan 06 2017 04:08
str.replace(/[^a-zA-Z0-9-]/g, '');
is not working
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 04:08
it should be
is the final - meant to be there?
Q_zheng
@zhengbusinesscontact
Jan 06 2017 04:09
@sega1219 product =product*arr[i][j];
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 04:11
str.replace(/[^a-zA-Z0-9]/g, ''); try that @zhengbusinesscontact
babajide odusola
@cesarecaravaggio
Jan 06 2017 04:18
whats the difference between |return and console.log|
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 04:18
console.log just logs something to console to help with debugging and stuff
babajide odusola
@cesarecaravaggio
Jan 06 2017 04:20
and how does it differ from return?
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 04:20
it doesnt really have any effect on the function
return is part of the function
babajide odusola
@cesarecaravaggio
Jan 06 2017 04:21
oh
DevRice
@DevRice
Jan 06 2017 04:21
function chunkArrayInGroups(arr, size) {
  // Break it up.
  return arr.reduce(function(r, v, i) {
    if (i % size === 0) r.push(arr.slice(i, i + size));
    return r;
  }, []);
}

chunkArrayInGroups([0, 1, 2, 3, 4, 5], 2);
Can someone please explain this code to me please?
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 04:23
explain it how?
CamperBot
@camperbot
Jan 06 2017 04:23
no wiki entry for: it how
DevRice
@DevRice
Jan 06 2017 04:23
Like what does arr.reduce do again?
and why does the function have three variables (r, v, i)
Dylan Hsiao
@greedylan
Jan 06 2017 04:24

in "Sort Union" challenge, what is this arr variable?? Its not an object nor a string.

var arr = [1, 3, 2], [5, 2, 1, 4], [2, 1]??? is this thing legal?
do I add more argument like function uniteUnique(arr, arr2, arr3){}?

function uniteUnique(arr) {
  return arr;
}
uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 04:24
it reduces the elements in an array
Ademola Adegbuyi
@ooade
Jan 06 2017 04:27
@greedylan arr would be [1, 3, 2]. You have to make use of the Arguments Object to grab the rest
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 04:28
This message was deleted
oops
Dylan Hsiao
@greedylan
Jan 06 2017 04:28
@ooade ty
CamperBot
@camperbot
Jan 06 2017 04:28
greedylan sends brownie points to @ooade :sparkles: :thumbsup: :sparkles:
:cookie: 792 | @ooade |http://www.freecodecamp.com/ooade
HeebieGeeBee
@HeebieGeeBee
Jan 06 2017 04:29
maybe i should sleep im seeing things
Ademola Adegbuyi
@ooade
Jan 06 2017 04:30
@HeebieGeeBee :+1:
Josh
@PageJimmy
Jan 06 2017 04:35
can i get some help plz
convertToF(0) should return a number
convertToF(-30) should return a value of -22
convertToF(-10) should return a value of 14
convertToF(0) should return a value of 32
convertToF(20) should return a value of 68
convertToF(30) should return a value of 86
i think im changing the code incorrectly
fahrenheit=0;
fahrenheit=-22;

function convertToF(celsius) {
var fahrenheit;
// Only change code below this line
fahrenheit=0;
fahrenheit=-22;

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

// Change the inputs below to test your code
convertToF(30);

Ademola Adegbuyi
@ooade
Jan 06 2017 04:38
@PageJimmy Do yo u know the formula used in converting from Celsius to Fahrenheit?
yaoshengli
@yaoshengli
Jan 06 2017 04:39
万能的神啊,谁知道匹配标点和空格的正则表达式
我需要帮助
Josh
@PageJimmy
Jan 06 2017 04:40
ya 9/5+32
yaoshengli
@yaoshengli
Jan 06 2017 04:41
可以写的完整点吗,我不太明白正则
Josh
@PageJimmy
Jan 06 2017 04:41
(c*9/5)+32
yaoshengli
@yaoshengli
Jan 06 2017 04:41
我试试
Ademola Adegbuyi
@ooade
Jan 06 2017 04:42
@PageJimmy You need to apply it i.e replace c with celcius and return the result
Sam Griffen
@ssgriffen
Jan 06 2017 04:42
Looking for critques on the JS and functionality of this so far, not the style (which I havent worked too much on)...appreciate any feedback I can get, thanks: http://codepen.io/ssgriffen/pen/VmOKEp
yaoshengli
@yaoshengli
Jan 06 2017 04:43
难道那个不是帮助我的正则吗?尴尬
Ademola Adegbuyi
@ooade
Jan 06 2017 04:45
@yaoshengli 去你的房间 ~ Google translate :sweat_smile:
yaoshengli
@yaoshengli
Jan 06 2017 04:46
ok,I need find the Google translate first……
Karanvir Singh
@KarnageKnight
Jan 06 2017 04:46
Hello everyone, i need some help on the Wikipedia viewer, i am unable to retrieve JSON data from the wikipedia api
Can someone help?
'''
CamperBot
@camperbot
Jan 06 2017 04:47
:bulb: to format code use backticks! ``` more info
Karanvir Singh
@KarnageKnight
Jan 06 2017 04:47
$(document).ready(function(){
  $("#button").click(function(){
    var url = "https://en.wikipedia.org/w/api.php?action=query&format=jsonp&prop=info&titles=Albert+Einstein";
    var x = document.getElementById("para");
   $.get(url,{},function(data){
      x.innerHTML(data);
    }); 
//     $.ajax( {
//     url: url,
//     data: 'hi',
//     dataType: 'json',
//     type: 'GET',
//     headers: { 'Api-User-Agent': 'karanvir95@gmail.com' },
//     success: function(data) {
//        // do something with data
//       x.innerHTML(data);
//     }
// } );
  });
});
Josh
@PageJimmy
Jan 06 2017 04:47
@ooade not sure how to set up the formula
Karanvir Singh
@KarnageKnight
Jan 06 2017 04:47
This is what my JS looks like
Josh
@PageJimmy
Jan 06 2017 04:47

function convertToF(celsius) {
var fahrenheit;
// Only change code below this line
ConvertToF*9/5+32

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

// Change the inputs below to test your code
convertToF(30);

Karanvir Singh
@KarnageKnight
Jan 06 2017 04:48
?
Can anyone help
Somia ♡
@somiajagadish
Jan 06 2017 04:48

// Setup
var myArr = [ 2, 3, 4, 5, 6];

// Only change code below this line
for (var i = 0; i < myArr.length; i++ ) {
console.log(myArr[i]);
}

Help??
:blue_heart: :cloud: :sparkles:
Ademola Adegbuyi
@ooade
Jan 06 2017 04:49
@PageJimmy replace ConvertToF*9/5+32 with farenheit = (c*9/5)+32
Karanvir Singh
@KarnageKnight
Jan 06 2017 04:49
@somiajagadish what are you trying to output?
Somia ♡
@somiajagadish
Jan 06 2017 04:49
@KarnageKnight Declare and initialize a variable total to 0. Use a for loop to add the value of each element of the myArr array to total.
Charity
@charityyoungblood
Jan 06 2017 04:49
Hello everyone. I've been at this for the past hour and cannot figure out what's wrong! :(
Any help would be appreciated
Here's my code
Ademola Adegbuyi
@ooade
Jan 06 2017 04:50

@somiajagadish

Declare and initialize a variable total to 0

Charity
@charityyoungblood
Jan 06 2017 04:50

//Changed string to lower case - no case sensitive issues
function palindrome(str) {
// Good luck

str=str.toLowerCase();
//Loop to replace special characters without using regular expression
for (var i = 0; i < str.length; i++) {
str=str.replace(/[ ( ) , . " " _ - ]/, "");

}
var anotherString = str.split("").reverse().join("");
if(str==anotherString) {
return true;
}
return false;
}

palindrome("eye");

Karanvir Singh
@KarnageKnight
Jan 06 2017 04:50
so u need to add all ur elements from the myArr? @somiajagadish
Charity
@charityyoungblood
Jan 06 2017 04:50
This is for the "Check for palindromes"
Somia ♡
@somiajagadish
Jan 06 2017 04:50
@ooade Didn't I do that?
Ademola Adegbuyi
@ooade
Jan 06 2017 04:51
@somiajagadish No, you didn't :sweat_smile:
Karanvir Singh
@KarnageKnight
Jan 06 2017 04:51
@somiajagadish you did not declare any variable
Somia ♡
@somiajagadish
Jan 06 2017 04:51
@KarnageKnight Where should I declare it? Because it said to only change code below that comment? :laughing:
Kevon Cambridge
@KevonTooPro
Jan 06 2017 04:51
So I am doing this challenge for java and I need to find all the multiples of 3 or 5 ranging to 1000
could someone help me?
Charity
@charityyoungblood
Jan 06 2017 04:51
It works for all except palindrome("0_0 (: /-\ :) 0-0")
Karanvir Singh
@KarnageKnight
Jan 06 2017 04:52
// Setup
var myArr = [ 2, 3, 4, 5, 6];

// Only change code below this line
var sum=0;
for (var i = 0; i < myArr.length; i++ ) {

  console.log(myArr[i]);
}
Then change it below the comment, doesnt make a difference does it? @somiajagadish
Josh
@PageJimmy
Jan 06 2017 04:52
@ooade made sense that way fahrenheit=(c*9/5)+32; but c is not defined
Ademola Adegbuyi
@ooade
Jan 06 2017 04:52
@KarnageKnight They said total...
Somia ♡
@somiajagadish
Jan 06 2017 04:52
@KarnageKnight Ohh okay thanks
CamperBot
@camperbot
Jan 06 2017 04:52
somiajagadish sends brownie points to @karnageknight :sparkles: :thumbsup: :sparkles:
:cookie: 267 | @karnageknight |http://www.freecodecamp.com/karnageknight
Somia ♡
@somiajagadish
Jan 06 2017 04:53
@ooade and thanks to :)
CamperBot
@camperbot
Jan 06 2017 04:53
somiajagadish sends brownie points to @ooade :sparkles: :thumbsup: :sparkles:
:cookie: 793 | @ooade |http://www.freecodecamp.com/ooade
Ademola Adegbuyi
@ooade
Jan 06 2017 04:53
@PageJimmy replace c with celcius
@somiajagadish YWC :wink: You're still coming back tho :sweat_smile:
Josh
@PageJimmy
Jan 06 2017 04:53
the boy wonder
thanks @ooade
CamperBot
@camperbot
Jan 06 2017 04:53
pagejimmy sends brownie points to @ooade :sparkles: :thumbsup: :sparkles:
:cookie: 794 | @ooade |http://www.freecodecamp.com/ooade
Karanvir Singh
@KarnageKnight
Jan 06 2017 04:53
@ooade yeah i'll let the challenge be a challenge and let her work it out :)
@ooade if she still needs help, she'll ask her, the sum will be the var we add
Somia ♡
@somiajagadish
Jan 06 2017 04:54
@ooade haha ur right
Ademola Adegbuyi
@ooade
Jan 06 2017 04:54
@KarnageKnight That's cool :smile:
Somia ♡
@somiajagadish
Jan 06 2017 04:54
Im back lol
var total = 0;
for (var i = 0; i < myArr.length; i++ ) {
console.log(myArr[i]);
}
Ademola Adegbuyi
@ooade
Jan 06 2017 04:54
@somiajagadish That was fast :smile:
Somia ♡
@somiajagadish
Jan 06 2017 04:54
i added the variable
Karanvir Singh
@KarnageKnight
Jan 06 2017 04:54
XDD
no you did not @somiajagadish
Somia ♡
@somiajagadish
Jan 06 2017 04:54
but its saying it should equal 20
@ooade IKR LOL
@KarnageKnight the var total
Ademola Adegbuyi
@ooade
Jan 06 2017 04:55
@somiajagadish Yeah, as your loop runs, you should set total to a new value i.e keep adding up myArray[i] to total
Karanvir Singh
@KarnageKnight
Jan 06 2017 04:56
var total = 0;
for (var i = 0; i < myArr.length; i++ ) {
total+=myArr[i
}
console.log(myArr[i]);
thats more like it @somiajagadish
@somiajagadish you need to add every element into the ''total'' variable until the array runs out
Somia ♡
@somiajagadish
Jan 06 2017 04:57
@KarnageKnight ohh THANKS
CamperBot
@camperbot
Jan 06 2017 04:57
somiajagadish sends brownie points to @karnageknight :sparkles: :thumbsup: :sparkles:
:warning: somiajagadish already gave karnageknight points
Somia ♡
@somiajagadish
Jan 06 2017 04:57
@ooade Thanks!
CamperBot
@camperbot
Jan 06 2017 04:57
somiajagadish sends brownie points to @ooade :sparkles: :thumbsup: :sparkles:
:warning: somiajagadish already gave ooade points
Ademola Adegbuyi
@ooade
Jan 06 2017 04:57
@somiajagadish :+1:
Somia ♡
@somiajagadish
Jan 06 2017 04:58
@ooade :thumbsup:
Karanvir Singh