Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,787 members, 7,956,012 topics. Date: Sunday, 22 September 2024 at 09:18 PM |
Nairaland Forum / Science/Technology / Programming / Javascript Study Group (13515 Views)
Lets Learn C# Here!(study Group For Beginners) / Study Group For C++ Learner (2) (3) (4)
(1) (2) (3) (4) (5) (6) (Reply) (Go Down)
Re: Javascript Study Group by TechCrunch909: 4:37pm On Dec 11, 2014 |
Does anyone have insight on BMC remedy software. |
Re: Javascript Study Group by Nmeri17: 12:37am On Feb 25, 2015 |
blueyedgeek: aha!! its this 500 page book I'm using I was surprised u didn't mention it in yo recommended books to download too bad I didn't come when blue eye was still a learner. now everything is an object to him well sha I hope you're still available to help. I'll be grateful if u can refer to that book's page 75. the codes from that page down to the end of the chapter is making me lose touch with reality whenever I attempt to approach that side, my heart starts doing gidigbam gidigbam |
Re: Javascript Study Group by blueyedgeek(m): 9:52am On Feb 25, 2015 |
Nmeri17: I'm still a learner oooo. There are just so many things to learn and I keep learning everyday. I've barely even scratched the surface and I don't think I've attained the mastery I seek. I wouldn't get to hung up if I were you. Take your time to re - read the chapter and re - read it until it becomes clear. If that doesn't help, skip the chapter and read other chapters and then after getting a better understanding you can go back to the chapter again. You know what, how about we both read the chapter again and on Saturday / Sunday, we come here to discuss the chapter thoroughly and iron out every issue, sounds good? |
Re: Javascript Study Group by Nmeri17: 2:36am On Feb 26, 2015 |
blueyedgeek:sorry I didn't reply earlier. I was hoping I'd finish that chapter before today. I got around some of the difficulties tho progress is not fast at all. hopefully I'll finish it later today. meanwhile Lemmi drop some questions to keep the thread alive: 1) what is the difference between the methods CharAt and indexOf?? 2) how do u get to make a closure without causing a stack to over flow or explode? 3) function remove (array, index) { return array.slice (0, index) .concat (array.slice (index + 1)); } console log (remove(["a", "b", "c", "d", "e"], 2) ); // ["a", "b", "d", "e"] sir/ma kindly explain line 2&3 of the object above in lay man's terms bonus: dyu use Phi |
Re: Javascript Study Group by blueyedgeek(m): 7:44am On Feb 27, 2015 |
Nmeri17:Lemme attempt 1 and 3. I don't fully understand question 2. 1. The charAt method simply stands for 'character at', from this break down, you know the method is used to return a character at a specific position in a string. You could also use array notation [] on a string and it would do the same thing. Use case: var myName = "Blueyedgeek"; The indexOf method returns the index position of a particular string. Use case: var myName = "Blueyedgeek"; The difference is in the arguments passed, charAt expects a number while indexOf expects a string. 3. The remove function takes two arguments, the array to act on and an index position (this should have been named stop if you ask me) to stop. When an array is passed in, the slice method is called on the array with a starting position of 0 and a stop position of anything passed to index. (0,0) should return the first item in the array. The array is then concatenated with a slice of the array starting at the stop position with an addition of one. I guess this isn't clear enough. Please ignore syntax errors, I'm on phone Let me try again, when the remove function is called with those arguments passed in, (a,b,c,d,e) and 2, the function first takes a slice of the array starting at position 0 (note that slice doesn't change the state of an array, it only returns a new modified array). Position 0 is "a", the stop position is 2. Note that the stop position isn't returned in the modified array. So let's break down what the function does in stages. It first returns a slice of the array with a stop position as specified by the argument passed in. The remove function is called with a stop position of 2 so calling (a,b,c,d,e).slice(0,2) will return a and b (note it doesn't return the item at the stop position). Now we have a and b. The function then calls concat on a slice of the array starting at the stop position plus one. When the slice method is called with only one argument, it returns everything from that position to the end of the array. So calling (a,b,c,d,e).slice(2 + 1) , 2 + 1 is 3. Let's rewrite to make it clearer (a,b,c,d,e).slice(3) will return d and e. Now we have a, b from the first operation and d , e from the second. The remove function concatenates these two arrays into one by calling the concat method. Concatenate is simply big word for join. Let's call the concat method on our values a, b, d , e. This returns (a,b,d,e). Hope this is clear I'll attempt two when I have a better understanding of closures. |
Re: Javascript Study Group by Nmeri17: 10:13pm On Feb 27, 2015 |
blueyedgeek: see this wayo boy. and you said you're still a learner. I actually saw this yo mention in the morning but I wanno reply when I'm settled back home. now let me read the explanation and modify |
Re: Javascript Study Group by Nmeri17: 10:30pm On Feb 27, 2015 |
hmmmmm...behold my eyes have been opened bro sup with that weekend class. u still game?? |
Re: Javascript Study Group by blueyedgeek(m): 5:50am On Feb 28, 2015 |
Nmeri17:I'm still learning oo, so many things to learn sef. The learning never really stops. |
Re: Javascript Study Group by blueyedgeek(m): 5:51am On Feb 28, 2015 |
Nmeri17:Yeah, I'm game. Side note: Ever heard of the odin project before? |
Re: Javascript Study Group by Nmeri17: 8:39am On Feb 28, 2015 |
blueyedgeek:yea I have. I've been at their website once but I've not signed up. I'm about to drop some questions. good morning |
Re: Javascript Study Group by blueyedgeek(m): 10:17am On Feb 28, 2015 |
Nmeri17:Cool by me. I'll try my best to answer any questions you might have and also be ready to answer mine too ooo. Regarding the odin project, I want to follow their guide and I wanted to know if you are interested. We could skip the html and css section and start with the javascript and continue from there. |
Re: Javascript Study Group by Nmeri17: 8:42pm On Feb 28, 2015 |
blueyedgeek:oh owky LOL. this one you said you'll ask me, my mind don dh cut just kidding. I'll sign up on there this night. you kno this question write a range function that takes two arguments start and end and returns an array containing all the numbers from start up to (and including end)?? I wrote function range (start, end) { var gold = []; gold.push = range; for (start = 1; start <= end; start++); return gold;} console.log (range(1, 10)); and its saying push: function |
Re: Javascript Study Group by blueyedgeek(m): 9:14pm On Feb 28, 2015 |
Nmeri17:well you assigned a property 'push' and passed the function range as the result and so it returns an array containing the function (I'm just guessing, I haven't tested it.) A simpler way to write this would be
|
Re: Javascript Study Group by blueyedgeek(m): 9:16pm On Feb 28, 2015 |
@nmeri17, you should also sign up for an account on codewars.com Social network for programmers (na code challenges full there ooo). |
Re: Javascript Study Group by Nmeri17: 9:20pm On Feb 28, 2015 |
blueyedgeek:code wars ke arr y'all tryna start a third world war with codes?? |
Re: Javascript Study Group by blueyedgeek(m): 9:34pm On Feb 28, 2015 |
Nmeri17:Trust me, it's refreshing. |
Re: Javascript Study Group by Nmeri17: 12:25am On Mar 01, 2015 |
blueyedgeek:**update github?? check Odin project?? check code wars pending. I need to answer questions from the secret life of objects before signing up and I'm not there yet those guys ain't joking at all if you're around yo system now u can try that prev question. yo code is returning 11 |
Re: Javascript Study Group by blueyedgeek(m): 7:58am On Mar 01, 2015 |
Nmeri17:I'll check it when I'm on pc but I'm quite sure it should work. Morning. |
Re: Javascript Study Group by Nmeri17: 12:27pm On Mar 01, 2015 |
blueyedgeek:morning bro. I've got another one: write a reverseArray function that takes an array as an argument and produces a new array that has the same elements in inverse order me:
or but it seems I'm missing something |
Re: Javascript Study Group by blueyedgeek(m): 1:05pm On Mar 01, 2015 |
Nmeri17:First off, there is a reverse method defined on Array.prototype that does this easily. A very simple reverse array function would look like this,
Now to your question, your function is supposed to be passed an argument and it is that argument that the body of your function should work on. So pass in a parameter and it is that parameter that you manipulate inside the body of your function. |
Re: Javascript Study Group by Nmeri17: 1:14pm On Mar 01, 2015 |
blueyedgeek:sorry I failed to state you can't use the reverse method yu should know this question |
Re: Javascript Study Group by blueyedgeek(m): 1:53pm On Mar 01, 2015 |
Nmeri17:Okay, that should give me a workout and light no dey make I test for pc. I will try it out when I have access to a system. I still think yours isn't working because of the parameter ish. Edit: This should work, Create a function that accepts one parameter. Create a locally scoped variable inside the function, it should be an empty array. Loop through the passed in array (passed as an argument) For each time the loop executes, the last item in the passed in array should be passed in to the temporary array as a first item. Return the temporary array and it will have the reversed form of the passed in array. Should look like this
|
Re: Javascript Study Group by Nmeri17: 2:52pm On Mar 01, 2015 |
blueyedgeek:just tested it I wish I had good news PS1: there arr two styles yu can uses. either simple input and return OR for statement. not both PS2: what's that len shii in line4 I'm going to pray that NEPA brings yo light. see u when my prayers arr answered |
Re: Javascript Study Group by blueyedgeek(m): 3:08pm On Mar 01, 2015 |
Nmeri17:I don't understand PS1. PS2: len is just another variable to hold and cache the length of the array passed in, good for performance (if we have an array of say 50,000 items, it only has to search for the length once and not 50,000 times). |
Re: Javascript Study Group by Nmeri17: 3:44pm On Mar 01, 2015 |
blueyedgeek:"input and return" as in u input the function value in yo array and return the reverse of yo input OR for statement. not both options. that's why my ist post had two options. dyu understand?? |
Re: Javascript Study Group by blueyedgeek(m): 4:27pm On Mar 01, 2015 |
Nmeri17:Nope or do you mean that the function will be called as a method on the array? |
Re: Javascript Study Group by Nmeri17: 7:51pm On Mar 01, 2015 |
blueyedgeek:nigga sup?? I mean something like function blueBoy(number){ where you input and return number. comprende?? |
Re: Javascript Study Group by blueyedgeek(m): 8:00pm On Mar 01, 2015 |
Nmeri17:You know what, why not post the question as is right here on this thread. Hope it won't be too much to type by hand? Alternatively, tell me the chapter and I"ll check the online book and we'll come here to discuss. |
Re: Javascript Study Group by Nmeri17: 8:05pm On Mar 01, 2015 |
blueyedgeek:exercise name: reversing an array page number 84 |
Re: Javascript Study Group by blueyedgeek(m): 8:13pm On Mar 01, 2015 |
Nmeri17:cool, lemme check it Edit: You are asked to write two functions and for both you are not allowed to use the reverse method. The first function reverses the array without changing it's original state. E.g var arr = [1,2,3,4,5]; reverseArray(arr) returns [5,4,3,2,1] but arr is still [1,2,3,4,5] The second function reverses the array and changes the state of the array. E.g var arr = [1,2,3,4,5]; reverseInArray(arr) returns [5,4,3,2,1] and arr is now [5,4,3,2,1] That's all there is to it really. |
Re: Javascript Study Group by Nmeri17: 8:39pm On Mar 01, 2015 |
^^^ lmao Oya write the code and test it let's see howfa |
Re: Javascript Study Group by blueyedgeek(m): 9:05pm On Mar 01, 2015 |
Nmeri17:cool, nepa bring light take am but small juice dey my laptop. Lemme try it out. |
(1) (2) (3) (4) (5) (6) (Reply)
What Is The Average Salary Of A Php Programmer In Lagos / Junit: How To Set Classpath On Windows Xp / Can I Learn Programming With My Smartphone
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 80 |