These are chat archives for FreeCodeCamp/HelpJavaScript

4th
Mar 2018
Brian
@BrianCodes33
Mar 04 2018 02:36
function scrollingText(text){   
   let upper = text.toUpperCase();
   let splitStr = upper.split("");
   console.log(splitStr)
   let result;
   for (var i=0; i<splitStr.length; i++) {
     result += splitStr[i].slice(1,splitStr[i].length) + splitStr[i].substr(0,1)
   }
   return result;
}
Test.assertDeepEquals(scrollingText("abc"), ["ABC","BCA","CAB"])
any ideas
Fabien SHAN
@X140hu4
Mar 04 2018 02:45
@BrianCodes33 link to the challenge?
Nazar
@IsaakNazar
Mar 04 2018 06:14
@BrianCodes33
function scrollingText(text){
  var arr = [];
  for (var i = 0; i < text.length; i++) {
    text = (text.slice(1) + text.slice(0,1)).toUpperCase();
    arr.push(text);
  }
   arr.unshift(arr.pop());
   return arr;
}
Nazar
@IsaakNazar
Mar 04 2018 06:26
@BrianCodes33
or with while loop
function scrollingText(text){
  var arr = [];
  var n = text.length;
  while(n>0){
    text = (text.slice(1) + text.slice(0,1)).toUpperCase();
    arr.push(text);
    n--;
  }  
   arr.unshift(arr.pop());
   return arr;
}
Kelechi Chinaka
@ke1echi
Mar 04 2018 06:31
function scrollingText(text) {
  text = text.toUpperCase();
  let arr = [text];
  for (let i = 1, length = text.length; i < length; i++) {
    arr.push(text.slice(i)+text.slice(0,i));
  }
  return arr;
}
@BrianCodes33
alpox
@alpox
Mar 04 2018 09:52
@BrianCodes33
function scrollingText(text){
  return text.split('').map((_, i) => (text+text).slice(i, i+text.length).toUpperCase());
}
Zunaid Aslam
@ZunaidAslam
Mar 04 2018 09:59
What one material (book or video) would you suggest that can help someone to become a intermediate javascript web developer?
Aditya
@ezioda004
Mar 04 2018 10:03
@Zunaid-Aslam I'd suggest net-ninja's videos I think he covers all the intermediate parts of JS, and then you have YDKJS book series which is probably the best one and everyone would recommend.
Zunaid Aslam
@ZunaidAslam
Mar 04 2018 10:11
Here is the problem I am facing
He does explains well
But it seems to real life projects are a bit more complex.

Whenever I go through tutorials, I tend to see basics being taught. Functions with one or two arguments.

And here when I am trying to do freecodecamp challenges, I see people using functions as arguments and what not.... I can't seem to figure out what's going on.

I even forgot my own logic trying to figure out something else lol.

Now I kind of have to ask others what I did here that worked :D.

Basically the knowledge I am trying to gain isn't systematic.

Zunaid Aslam
@ZunaidAslam
Mar 04 2018 10:17
For example, this is from my own project. I was feeling like a rockstar when I solved the weather challenge. Now I am confused about the part where data is being passed as an argument. What is this data? Why are we using data instead of just name. I remember I actually understood it when I was doing and randomly researching. But now forgot and don't even know where to look :
$.ajax({
url : Weather,

success : function(data) {
  var city= data.name;
  var tempC= data.main.temp;
  var tempF= Math.round(1.8 * data.main.temp);
  var country= data.sys.country;
  var weather = data.weather[0].main;
  var weather = weather.toLowerCase();
  var weatherDes =data.weather[0].description;
  var icon= data.weather[0].icon;

       $('#country').text(", "+ country);
     $('#temperature').text(tempC);
     $('#symbol').text(String.fromCharCode(176));
     $('#weather').text(weather);
     $('#city').text(city);

      var $temp = $("#temperature");
      var $unit = $('#unit');




     $("#changeT").click(function () {
  var val = $temp.text();
  var uni = $unit.text();
  $temp.text(val == tempC ? tempF : tempC);
  $unit.text(uni === 'C' ? 'F' : 'C');
});
Pieter Stokkink
@forkerino
Mar 04 2018 10:26
@alpox interesting solution with the text+text! I had this:
const scrollingText = (text) => [...a=text.toUpperCase()].map((_, i) => a.slice(i) + a.slice(0,i))
Aditya
@ezioda004
Mar 04 2018 10:36

@Zunaid-Aslam data is just a argument, you can call it whatever you want. It simply returns the data as a response from the server.
IMO when stuck in situations like these always read the docs, in your case read http://api.jquery.com/jquery.ajax/
From their docs about success

A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter or the dataFilter callback function

Its always a good idea to look at official docs, always helps

alpox
@alpox
Mar 04 2018 10:53
@forkerino also a nice solution :)
Zunaid Aslam
@ZunaidAslam
Mar 04 2018 11:19
I guess reading the official doc alongside working would be a good idea
Zunaid Aslam
@ZunaidAslam
Mar 04 2018 11:30

@ezioda004 It wasn't about calling. For example if i declare an object named days and in it property called name which is an array and first name is sunday.

To access Monday, I am suppose to write days.name[1] if I am correct. Here days is an object.

I can somehow understand the thing here and visualize.

What is data here?
I didn't declare it any where. I haven't given it any value. And why should I even use it lol.

Why not just write name instead of data.name

I will read the doc and try to understand. Hopefully it will make things clear.

Aditya
@ezioda004
Mar 04 2018 11:40

@Zunaid-Aslam Oh data from the weather api if you used fccs endopint uses https://openweathermap.org/current, just the endpoint is different. So by default you recieve JSON, JSON (JavaScript Object Notation) syntax was inspired by objects and you access them the same way as objects. The difference is that JSON "keys" are always string whereas in objects you dont need to make keys string. You can think of them as subset of objects.

Why not just write name instead of data.name

Thats because the JSON api sends back needs to be accessed accordingly to use
Look at this example api.openweathermap.org/data/2.5/weather?q=London
This whole JSON is what you get from success and its stored in data argument.

Aditya
@ezioda004
Mar 04 2018 11:49
I guess the above link wont work because it needs a key in order to make a request but I think you're getting confused about API and how they work.
In the weather project. You're basically getting users location then requesting it from openweather API, if your request is success they send you the data or JSON which you're storing in a variable called data and then manipulating it.
Nazar
@IsaakNazar
Mar 04 2018 12:38
@Zunaid-Aslam I guess you should read about function arguments, also read function as an arguments
there are videos on youtube 'javascript understanding the weird parts' where this kind of things explained really well
Aditya
@ezioda004
Mar 04 2018 12:38
@IsaakNazar Big word alert :laughing:
Nazar
@IsaakNazar
Mar 04 2018 12:39
@ezioda004 yess, I'm just finishing his videos, he is doing really perfect explanations :smile:
Aditya
@ezioda004
Mar 04 2018 12:40
@IsaakNazar Nice, I completed the course and its definitely worth it
Nazar
@IsaakNazar
Mar 04 2018 12:41
@ezioda004 I plan to go through his node js tutorials, Hope it will worth it too :smile:
Aditya
@ezioda004
Mar 04 2018 12:42
@IsaakNazar Same, atm I'm learning React so will have to wait till then
Nazar
@IsaakNazar
Mar 04 2018 12:43
@ezioda004 what resources are you using to learn React?
Aditya
@ezioda004
Mar 04 2018 12:44
@IsaakNazar FCC beta (pretty good) and max's Modern react and redux
Nazar
@IsaakNazar
Mar 04 2018 12:45
@ezioda004 :+1:
Amit Patel
@AmitP88
Mar 04 2018 12:45

hey guys, is there anyway to create an object and have the keys as numbers? If not, is there a workaround?

example:

  var numerals = {
          1: 'I',
          2: 'II',
          3: 'III',
          4: 'IV',
          5: 'V',
          6: 'VI',
          7: 'VII',
          8: 'VIII',
          9: 'IX',
         10: 'X',
         50: 'L',
        100: 'C',
        500: 'D',
       1000: 'M'
  };
Fabien SHAN
@X140hu4
Mar 04 2018 12:46
@AmitP88 Maybe inverting keys and value?
Amit Patel
@AmitP88
Mar 04 2018 12:47
@X140hu4 I'll give it a try. Thanks! :)
CamperBot
@camperbot
Mar 04 2018 12:47
amitp88 sends brownie points to @x140hu4 :sparkles: :thumbsup: :sparkles:
:cookie: 343 | @x140hu4 |http://www.freecodecamp.org/x140hu4
Aditya
@ezioda004
Mar 04 2018 12:47
@AmitP88 The above object works but to access them you have to use bracket notation. numerals[1] // "I"
Amit Patel
@AmitP88
Mar 04 2018 12:48
@ezioda004 ah ok, thank you :)
CamperBot
@camperbot
Mar 04 2018 12:48
amitp88 sends brownie points to @ezioda004 :sparkles: :thumbsup: :sparkles:
:cookie: 492 | @ezioda004 |http://www.freecodecamp.org/ezioda004
Amit Patel
@AmitP88
Mar 04 2018 12:48
im working on the roman numeral converter algorithm lol
Aditya
@ezioda004
Mar 04 2018 12:49
I wrote such a !DRY code for that lol
Amit Patel
@AmitP88
Mar 04 2018 12:49
lol

Here's my solution so far if you're curious:

function convertToRoman(num) {  
  // create object for roman numerals 1 through 1000
  var numerals = {
          1: 'I',
          2: 'II',
          3: 'III',
          4: 'IV',
          5: 'V',
          6: 'VI',
          7: 'VII',
          8: 'VIII',
          9: 'IX',
         10: 'X',
         50: 'L',
        100: 'C',
        500: 'D',
       1000: 'M'
  };

  // array that will hold roman numerals converted from num
  var converted = [];

  // switch case based on num
  switch(num){
    // for numbers 0 to 10
    case ((num > 0) && (num <= 10)):
      if(numerals[num]){
        converted.push(numerals[num]);
      }
      break;
    case 2:
      break;
    case 3:
      break;
    case 4:
      break;
  }

  return converted;

}

convertToRoman(2);

It doesn't work yet, but i'm hacking away at it

Stephen James
@sjames1958gm
Mar 04 2018 12:58
@AmitP88 If I gave you then number 1234 to convert to roman numeral how would you do it?
Amit Patel
@AmitP88
Mar 04 2018 12:59
@sjames1958gm not too sure yet (I haven't gotten to the bigger nums yet, still working on 1-10), but I would probably break that number into an array and then iterate through it and use some rules for each index
that would be on another case
Stephen James
@sjames1958gm
Mar 04 2018 13:00
@AmitP88 Assuming you aren't a computer how would Amit do it.
Amit Patel
@AmitP88
Mar 04 2018 13:00
lol idk XP
I've been stuck on this algorithm for a few days now
Zunaid Aslam
@ZunaidAslam
Mar 04 2018 13:01
@ezioda004 Ah! Json in the data. Now it kinda makes sense. Thanks! Lack of systematic approach is confusing me. I will follow @IsaakNazar suggestion.
CamperBot
@camperbot
Mar 04 2018 13:01
zunaid-aslam sends brownie points to @ezioda004 and @isaaknazar :sparkles: :thumbsup: :sparkles:
:cookie: 311 | @isaaknazar |http://www.freecodecamp.org/isaaknazar
:cookie: 493 | @ezioda004 |http://www.freecodecamp.org/ezioda004
Stephen James
@sjames1958gm
Mar 04 2018 13:01
Maybe start with a non-computer algorithm first
Amit Patel
@AmitP88
Mar 04 2018 13:02
@sjames1958gm so basically write it out in plain english?
Stephen James
@sjames1958gm
Mar 04 2018 13:03
1234, is greater than 1000, so place M, subtract 1000 -> 234
234, not greater than 1000, 500 ...
234, is greater than 100, so place C, subtract 100 -> 134
134, is greater than 100, so place C, subtract 100 -> 134
34 is not greater than 100, 50
34, is greater than 10, so place X, subtract 10 -> 24
etc.
@AmitP88 plain English with a little math involved
Amit Patel
@AmitP88
Mar 04 2018 13:04
@sjames1958gm ahhh I see. that makes more sense.
damn, it's gonna take me a while before I get the hang of these. I always seem to either think the wrong way about it or just overcomplicate things
Stephen James
@sjames1958gm
Mar 04 2018 13:05
My first attempt had if statements for each letter, number combo, once I got that working, I determined ways to make it data driven
For these algortihms I don't think code first I think how would I solve the problem manually then commit to code.
Amit Patel
@AmitP88
Mar 04 2018 13:07
I see. yeah, that's a habit I gotta get into. I always tend to just try to put js concepts together, but I need to slow down
Stephen James
@sjames1958gm
Mar 04 2018 13:07
With more experience, the transition from algorithm to code will become more intuitive
Amit Patel
@AmitP88
Mar 04 2018 13:09
for sure. I'm hoping to get the front end certificate by the end of this month. I have 13 int algos and the adv projects to go
do you think this goal is feasible?
alpox
@alpox
Mar 04 2018 13:13
@AmitP88 I lately had a discussion about how to think about the construction of an algorithm and putting it into code. I'm not sure if it helps you, but I thought you might find it useful or at least interesting :) I came up with this order of the process:
  1. Build up the general idea (Logical solution) in your head or on paper - no code involved, just abstract thinking - logics.
  2. Take single steps which are outlined very high-level and describe them still logically in more detail
  3. do 2. until you have enough small logical pieces
  4. Try to solve these small little logical pieces in code (Here is the first time where code comes into play)
  5. Bind together the solutions
Amit Patel
@AmitP88
Mar 04 2018 13:14
@alpox would this work for coding interviews too?
alpox
@alpox
Mar 04 2018 13:14
@AmitP88 If they ask you how you generally go for solving an algorithm problems, probably yes. But they usually don't ask that i think.
This is mainly a guideline for you when trying to construct an algorithm.
Most important is probably: Don't try to directly think in code, but try to think about an abstract, logical way for solving things.
Amit Patel
@AmitP88
Mar 04 2018 13:15
@alpox ah ok. I'll definitely try this out. seems like the farther I get with the int algos, the longer it takes me to solve the next one
for sure. that's my biggest problem - resisting the urge to jump directly to code and coding concepts
@alpox thanks! :)
CamperBot
@camperbot
Mar 04 2018 13:16
amitp88 sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:star2: 1567 | @alpox |http://www.freecodecamp.org/alpox
alpox
@alpox
Mar 04 2018 13:17
@AmitP88 np :)
Stephen James
@sjames1958gm
Mar 04 2018 13:27
@AmitP88 It is going to be a tough month to get all that done.
@alpox Good list!
Amit Patel
@AmitP88
Mar 04 2018 13:28
@sjames1958gm yeah, it is :worried: but I'
I'm hoping if I can achieve that, then I can maybe get the data vis cert by the end of may
that way by june, I can start applying for dev jobs
I'm really tired of my current job and am trying to get out asap
Stephen James
@sjames1958gm
Mar 04 2018 13:30
@AmitP88 good luck! When you get stuck don't be afraid to go back a step or two.
I have known too many programmers that are lost in the weeds and instead of backing out the way they got
There they just whack harder with the same machete
Excuse my lame metaphor :)
Amit Patel
@AmitP88
Mar 04 2018 13:30
@sjames1958gm no worries, I understand :) do you think it's possible to do this though? to get both certs by the end of may?
I know it won't be easy, but as long as it's possible, I'm willing to go for it
Stephen James
@sjames1958gm
Mar 04 2018 13:32
It's going to take some discipline, but you can do it.
Amit Patel
@AmitP88
Mar 04 2018 13:34
thanks. I really appreciate your help and encouragement. I've heard from others that to get your first dev job, you gotta apply to a ton of companies, so I want to be able to dedicate a good 3-4 months to applying for jobs
alpox
@alpox
Mar 04 2018 13:36
@AmitP88 It does not have to be many. Often its better to focus on specific companies and take your time to really adjust your documents and efforts on that company/ies.
I lost the article but there was a good one about that lately on linkedin :D
Amit Patel
@AmitP88
Mar 04 2018 13:37
@alpox oh yeah, I was planning on doing that - tailoring each resume/cover letter to each job
do you think it's getting more and more difficult to get an entry level dev job these days?
alpox
@alpox
Mar 04 2018 13:38
@AmitP88 https://www.thejobnetwork.com/why-applying-to-as-many-jobs-as-possible-can-be-a-mistake/
I'm not sure if that was the one I saw back then though
I think its getting more and more easy to get such a job these days as the request for devs is much higher than there are devs on the market
At least thats the case where i live
Amit Patel
@AmitP88
Mar 04 2018 13:40
where do you live if I may ask? I live in California, about 3 hours away from LA
alpox
@alpox
Mar 04 2018 13:41
I live in Switzerland
Amit Patel
@AmitP88
Mar 04 2018 13:41
I see
alpox
@alpox
Mar 04 2018 13:41
Aha so you're not far from silicon valley? :D
Amit Patel
@AmitP88
Mar 04 2018 13:41
nope lol
but I think it's pretty competitive here. I've heard Texas is also a good place to get dev jobs
alpox
@alpox
Mar 04 2018 13:42
I heard business is hard there :D
Amit Patel
@AmitP88
Mar 04 2018 13:42
it is
alpox
@alpox
Mar 04 2018 13:43
Yea i heard quite some stories about the live of a dev in silicon valley. Mostly lots of money but working your ass off :D
Amit Patel
@AmitP88
Mar 04 2018 13:43
I've been learning to code since 2015. I really want to make it happen this year. I can't stand my current job much longer lol. We'll have a break around may and probably won't start back up until late september/october, so I really want to get job ready in that time
lol oh yeah, like if you're at the big companies then yeah
for now, I just want a place to start. hell, I dont even care about salary at this point, as long as I can get some exp
alpox
@alpox
Mar 04 2018 13:44
Well, go ahead then :) Practice is the best way there
I'll be around to answer questions sometime
Amit Patel
@AmitP88
Mar 04 2018 13:46
lol thanks
yeah, I gotta practice my ass off this year. especially with javascript
alpox
@alpox
Mar 04 2018 13:46
:thumbsup: that can be fun :)
You will probably hit your head often, but just keep in mind when that happens, that that is perfectly normal and the best way to learn ;)
Amit Patel
@AmitP88
Mar 04 2018 13:48
lol I'll try not to get a concussion :P
Fabien SHAN
@X140hu4
Mar 04 2018 13:48
@AmitP88 What's your plan for this month?
alpox
@alpox
Mar 04 2018 13:49
@AmitP88 Good plan :D
Amit Patel
@AmitP88
Mar 04 2018 13:49
@X140hu4 I want to get the Front End Certification by the end of this month. so far I have 13 intermediate algorithms and the 4 advanced projects left to do
@alpox lol thx
CamperBot
@camperbot
Mar 04 2018 13:49
api offline
amitp88 sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
Fabien SHAN
@X140hu4
Mar 04 2018 13:50
Ok, definitely doable :) It took me about a month to finish the last projects
I had all the algo done though
Nazar
@IsaakNazar
Mar 04 2018 13:50
yeah, I find programming real abstract, I mean you cant do programming if you cant abstract each character or words that we type when do coding with real world, or your own abstract world. So programmin nothing if its not attached with some abstract things in your mind, through imagination process. It becomes just a typed characters. Example: how to understand the word closure? It's impossible just read docs and understand it , you cant point to something and say thats 'its a closure', like you pointing when you see dogs, computer, your mom and so on. You have to associate it in your braing with something imaginable, that you can see perfectly. Our current languages is not perfect.
Fabien SHAN
@X140hu4
Mar 04 2018 13:50
@IsaakNazar +1
Amit Patel
@AmitP88
Mar 04 2018 13:51
@X140hu4 yeah, I started fcc on january 10 this year, so I was hoping it would take be a little over 2 months to finish the first cert
then I want to see if I can get the data cert by the end of may
@IsaakNazar exactly! I'm starting to see more and more that programming is ultimately about learning patterns and how they work together to complete objectives
alpox
@alpox
Mar 04 2018 13:53
@IsaakNazar I'd usually try to tell newcomers not to dive too deep into such descriptions/names like closure as they are usually not well defined.
Best is probably to think about programming problems in real-world scenarios but through trying to create instruction steps for the worst idiot and he would manage to solve the problem with just following exactly the instructions.
Nazar
@IsaakNazar
Mar 04 2018 14:01
@alpox we're all in the same boat
Stephen James
@sjames1958gm
Mar 04 2018 14:03
@AmitP88 There are tons of dev jobs here in Dallas
Amit Patel
@AmitP88
Mar 04 2018 14:04
@sjames1958gm would it be difficult to get a position there since I live in California?
Stephen James
@sjames1958gm
Mar 04 2018 14:04
@AmitP88 Possibly difficult, because companies are likely not going to pay for travel/relocation for entry level
Amit Patel
@AmitP88
Mar 04 2018 14:05
@sjames1958gm yeah. I mean, I'm willing to pay for my own relocation though, but I'd probably have to state that clearly in a cover letter huh?
Stephen James
@sjames1958gm
Mar 04 2018 14:06
@AmitP88 yes. make that clear.
Amit Patel
@AmitP88
Mar 04 2018 14:06
@sjames1958gm do you think that after I finish the first two certs I would be ready for an entry level dev job?
I'd still be working on the 3rd cert when applying though
Stephen James
@sjames1958gm
Mar 04 2018 14:08
@AmitP88 Should be. There are so many parameters these days. front vs back, design vs code, framework vs vanilla js.
Nazar
@IsaakNazar
Mar 04 2018 14:09
@AmitP88 so you did started FCC two months ago?
Amit Patel
@AmitP88
Mar 04 2018 14:09
@sjames1958gm exactly. it gets pretty confusing
@IsaakNazar well, I originally did most of the front end cert early last year, but I read a lot of tutorials for the projects and sucked at the algos (had to look up solutions often). so I felt like I was cheating myself. I decided to take a break from that and try to make my own apps, but that ended up taking too long (wasn't getting enough things done), so this year, I reset my progress on FCC and started over, legitimately this time and am doing much better
Stephen James
@sjames1958gm
Mar 04 2018 14:11
@AmitP88 Ok. Enough talk, back to work :)
Amit Patel
@AmitP88
Mar 04 2018 14:11
this time, I didn't look at any tutorials for the projects (just stackoverflow and documentation), and I've only had to look at the solutions for algorithms for maybe 3 of them total
@sjames1958gm lol yes sir :P
Nazar
@IsaakNazar
Mar 04 2018 14:12
@AmitP88 dont worry man, you are in the US, where millions of dev jobs, I really envy you
Amit Patel
@AmitP88
Mar 04 2018 14:12
@IsaakNazar yeah, but I feel like it's really competitive here. where are you?
Nazar
@IsaakNazar
Mar 04 2018 14:15
@AmitP88 I'm in the Middle Asia, in my current location, only maybe maximum 5-7 web dev jobs for juniors, so it sucks,
Amit Patel
@AmitP88
Mar 04 2018 14:15
@IsaakNazar I see. over here, it seems like most ppl want mid-senior level devs
Nazar
@IsaakNazar
Mar 04 2018 14:17
@AmitP88 if you middle or senior you have a more chance to get positions from those 5-7
Amit Patel
@AmitP88
Mar 04 2018 14:17
@IsaakNazar seems like that's the case anywhere :P
Nazar
@IsaakNazar
Mar 04 2018 14:18
@AmitP88 man you have more opportunities in the US, than enywhere else
Amit Patel
@AmitP88
Mar 04 2018 14:19
@IsaakNazar I hope I can get one lol. I'm fed up of my job already but I can't quit yet
Stephen James
@sjames1958gm
Mar 04 2018 14:20
@IsaakNazar What country are you in, we just a had a couple of young men from Kazakhstan for a week
at our house (they were here for a acrobatics competition)
Nazar
@IsaakNazar
Mar 04 2018 14:21
@sjames1958gm yeah, I'm from Kyrgyzstan, its next to the Kazakhstan
thanx to English language , that giving me tons of knowledge :smile:
Stephen James
@sjames1958gm
Mar 04 2018 14:26
@IsaakNazar They only spoke Russian - grateful for google translate
Nazar
@IsaakNazar
Mar 04 2018 14:28
@sjames1958gm haha :smile:
@sjames1958gm well russian language is everywherein the former Soviet Union countries
Stephen James
@sjames1958gm
Mar 04 2018 14:31
@IsaakNazar Yeah, that is what we got from them. We knew a former Russian lady who came over one night to translate
Nazar
@IsaakNazar
Mar 04 2018 14:34
@sjames1958gm wow, they got good opportunity to learn english
Stephen James
@sjames1958gm
Mar 04 2018 14:46
@IsaakNazar yeah, but they were pretty busy with training
Nazar
@IsaakNazar
Mar 04 2018 15:01
@AmitP88 is it possible to live(spend only for food, for room if you are renting a room, and spend for other stuffs minimally) to your 2-3 month salary for an entire year?
Amit Patel
@AmitP88
Mar 04 2018 15:01
@IsaakNazar you mean, like use my savings and quit my job?
it would only last for maybe 5 months max
then i'd be broke
Nazar
@IsaakNazar
Mar 04 2018 15:02
@AmitP88 yes, I would safe and learn hard, so in a year you will become pretty ready for junior maybe middle :smile: position
Amit Patel
@AmitP88
Mar 04 2018 15:03
@IsaakNazar I can't afford to quit, but the good thing is my job is seasonal, so I'll have a few months off starting in may or june
Nazar
@IsaakNazar
Mar 04 2018 15:04
@AmitP88 12 hours a day to learn programming, that would be awesome :smile:
This message was deleted
Amit Patel
@AmitP88
Mar 04 2018 15:05
@IsaakNazar yeah, i'm pretty much gonna use my summer like that lol. rumors from my coworkers say that we might be down for 5-6 months so I'm hoping that's the case
Nazar
@IsaakNazar
Mar 04 2018 15:06
@AmitP88 you have tons of opportunities , good luck man :+1:
Amit Patel
@AmitP88
Mar 04 2018 15:07
@IsaakNazar thanks bro. it's gonna be tough, but I gotta get it done :)
CamperBot
@camperbot
Mar 04 2018 15:07
amitp88 sends brownie points to @isaaknazar :sparkles: :thumbsup: :sparkles:
:cookie: 312 | @isaaknazar |http://www.freecodecamp.org/isaaknazar
AbrisM
@AbrisM
Mar 04 2018 22:23
Hi everyone
Is there a networking channel available on GITTER?
Jen
@jenniredfield
Mar 04 2018 22:32
Hi is anyone here
Ken Haduch
@khaduch
Mar 04 2018 23:00
@jenniredfield - some people are always around - what's up? If you're still here...
Ken Haduch
@khaduch
Mar 04 2018 23:14
@jenniredfield - if you have a question, please post it and someone will most likely reply, I'll check in if you tag me in your question, I'll be back on in a couple hours...

function wordsToObject(input) {
    input = input.split(" ");
    let res = [];
    for(let i = 1; i < input.length; i+=2){
      res.push({
        name: input[i-1],
        id: input[i]
      });
    }
    return res;
}
any idea what's wrong here?
I dont get it I output what's asked
Stephen James
@sjames1958gm
Mar 04 2018 23:37
@tiagocorreiaalmeida It looks like the test values are strings, not arrays??
Tiago Correia
@tiagocorreiaalmeida
Mar 04 2018 23:37
hum but look at their idea field
its not wrapped in ""
only the array?
Stephen James
@sjames1958gm
Mar 04 2018 23:39
@tiagocorreiaalmeida there test value is a string, not sure what they want
"[{name : 'red', id : '1'}, {name : 'yellow', id : '2'}, {name : 'black', id : '3'}, {name : 'white', id : '4'}]"
Tiago Correia
@tiagocorreiaalmeida
Mar 04 2018 23:40
I think I got an idea, what a strange exercise :D
Stephen James
@sjames1958gm
Mar 04 2018 23:40
@tiagocorreiaalmeida yeah
Tiago Correia
@tiagocorreiaalmeida
Mar 04 2018 23:47
``function wordsToObject(input) { input = input.split(" "); let res = ""; for(let i = 1; i < input.length; i+=2){ res+=, {name : ${input[i-1]}, id : ${input[i]}}`
}
return "[" + res.slice(2) + "]";
}
function wordsToObject(input) {
    input = input.split(" ");
    let res = "";
    for(let i = 1; i < input.length; i+=2){
      res+=`, {name : ${input[i-1]}, id : ${input[i]}}`
    }
    return "[" + res.slice(2) + "]";
}
I dont know I give up of this one xd
Stephen James
@sjames1958gm
Mar 04 2018 23:48
@tiagocorreiaalmeida Yeah, looked poorly designed