Jump to content

L8V2L

Members
  • Posts

    788
  • Joined

  • Last visited

Everything posted by L8V2L

  1. Now that is way to advance for me, I'mma go back to developer MDN and keeping over the basic of JavaScript. But thinks any way.
  2. function factorial(n) { if(n == 0 || n == 1) { return 1; } else { return n * other(n - 1);// That's crazy... I through no out side influence can happen in a function?!?! }}var other = factorial; // So how is this possible?!?!?alert( factorial(10) );
  3. I did as you said, and it made me went to go over the hold thing... as indicated in my signature which redirect you to my pic, I read over JavaScript tutorial two time, but due to thought roaming, I did not receive every thing I should or would have it if wasn't for my mind drifting off. THANK YOU! After I'm finishing going through developer MDN guide on JavaScript, I will return to either scheme through, or strictly parses through it for more refresh.It said you need an (function(){;})() around the code to evoke it self. Yours don't have that.
  4. L8V2L

    Help!

    I like that better... but as it id describe, I think the octopus one is a little bit correct, please hear me out: Now the true meaning or job for a identifier(variable) is to grasp(I say grasp not from the book I gather this, but cause of the book and me comparing it to other different resource) the value, for when you define a value in the console, it life span only last for a short amount of time, after that, there no way to evoke that same value, so like two, if I just console.log(2); then, it'll show two on the console, but that... is just a photograph of two, for the real value of two is dead(meaning that it can't be evoke back)... I could say more but I think that's good enough... But I like yours analogy... so I'mma alter this concept for that concept, but also change yours up to better fit my look on it: ...(actually it's going to be very similar)... you know I like yours but as I think on it... grasping it make more since, like the variable put the value on life support, keeping the value a live with in it self... but your make since to say it in this way, a variable is just... let change it up, it's just a picture frame that holds a picture of the value, of how the value you, and what the value is, so every time the console see this picture frame with it's picture inside, it'll recreate an identical value... there is many ways of looking at it, but as long as one get an understanding of the two and their relation to the console, or environment they are present in. This:var num = function(x) { // The outer function defines a variable called "x" var add = function() { return(x+=2); // The inner function has access to the "x" variable of the outer function } return add; // Return the inner function, thereby exposing it to outer scopes }, dition = num(2); dition(); // Returns 4like addition, subtraction, and multiplication are not scopesAnd... about the pet.name I'm just saying it was grasping the function it self by the function name.
  5. And I'm not talking about the definition, I'm talking about distinction of a recursive function from a regular function... You just gave me the definition, but I ask for how to tell it by looking at it, the definition, just tell it's functionality, but not how to identified it.How do you identified it: Is this is how you identified it? Yes, or no then so follow up feedback please.
  6. L8V2L

    Help!

    In this book that you suggest for me to read: http://eloquentjavascript.net/chapter2.html speak on a variable as an octopus that grasp the value, than looking at a variable as a book shelf or etc on how would could think of variable... but guessing that this is just to give an ideal even know the author speak on speaking of this as it should be speaking on. I click the wrong tab on my browser, and though you brought me somewhere else. I'm going through the developer MDN JavaScript guide. That book you brought back in to mind when you first link it to me, I was enjoying it until it got to something way advance, so I stop reading it cause I didn't want to go on not understanding. So please understand that, if I don't feel comfortable, or feel like I have a understand of something, and plus I only want beginner tutorial, so... I rather for you to not to say advance topic, for I feel like I.... let me try again explaining it. So a closure is when you grasp(set)the operation of evaluating in a function scope(the environment for which it is define) in the identifier(variable) so now cause in a sense froze or made an opening into the function scope by attaching it to a variable, you can now access that scope. Is this some what correct?There is question in the first one I give that I desire and need to be answer, so I'mma revise it:A closure seem like to me as a variable just grasping(setting/attaching) the parent function name to that identifier(variable)... I'm guessing the power of this is that as doing so can gain access into that function by such means as the pet.setName(), mean that if this was a mathematic function, I can gain access through that function as so pet.setName(). In putting any value as I please between the parentheses... So in turn, that would show case it's true power, cause of that fact since I define the parent's function name in pet, by pet grasping it, I can use the variable name pet to access all other sub-level function or child function of the parent function.... (meaning is that I could put in a number in a mathematic operator and it'll return a different value by that scope(here by saying this I'm answer my only question that I ask farther into the read, but I don't know if this true or not, I'm asking in different scope, do that value skip the parent scope, and just be operated in the scope that define the mean of access(mean that pet.getName() by putting a value in this, and this scope is set in the middle, does the operation which is define in the scope above it does not apply to this value, as if... for example, the first scope the parent scope, is addition, the second scope, the child scope, is subtraction, and this scope is multiplication, the value if set in the multiplication as so pet.mltiplication(3) will be multiple, and not go through any of the other operation define before it for the simple fact is that scope outside of another scope does not have access to that scope, but that scope does have access to the other scope variable)))If true(and please, despite me typing this, I still would like a more in depth perceptive of this from some one who is a wizard... if that term is not use as I though it was than please excuse mean. When I say wizard, I'm referring to one who is experiences in programming. For I am a novice.)than does this mean by typing pet.setName() I skip the parent function and went to the second level or the first child of the nest function. Same for pet.getSex(); and pet.getName(); Do that mean again, I skip to these nested function, meaning that my value that I set between the parentheses, does not get touch by any of the function that follow it, but not the function that proceed it, so the value is pass through those function? As I said, if this is correct, still please explain to me in your own perceptive, or and the perceptive of the greater practice.
  7. Okay... I know the definition... That wasn't the question.
  8. L8V2L

    Help!

    So my explanation is wrong? I feel as if your way of exampling it is... I'll be more secure with this if I could example it back. So my explanation is wrong? What's the link for?
  9. L8V2L

    Help!

    I don't mind feedback, but yours is more of a, you can't do this, or you can't do that, despite the fact that I say over and over again I WANT A STRONG FOUNDATION OF JAVASCRIPT!!!!!!!!!!!!!!!!! let me put it in my signature so you can always remember that I reach for a strong foundation of JavaScript.
  10. You got it wrong, I'm all about the foundation, I'm going down the list with these tutorial, and going to go back over! A parses function like parsesfloat and parsesInt are two function that parses through a string to look for number. a parsesfloat function look for any number, - + sign, and decimal sign, any thing else, it'll ignore and return everything previses. Example: -132.3423d3244234, from this number it'll return -132.3423. parsesInt only return hold number, so with the same example, it will return only, 132(don't want to look back(cause I'm trying to go off of memorize), but I believe that it's) it convert -132 to 132 or I think integer number also have negative, but isn't saying -10 the same as 0.1. Any way, I'm going through tutorial to for-memorize my self.... What's is advance? Tell me that? What is advance programming? With each tutorial, I make sure it's start at a beginner level, or even stay at a beginner level, don't tell me such a thing(I don't want it to effect me, such words). If a tutorial step over the line of beginner stage, I stop reading it. Did it before. Thank you Ingolme!So a recursive function contain the name of it's function inside the function it self correct? Please answer anyone, and more feedback on that, cause it can't be the simple.(I'm not doubting you, just would love to read more feedback on this.)
  11. How you feel about these justsomeguy and anyone else.coffescriptAmber SmalltalkHaxeDartOpaTypeScript, an open-source, strict superset of Javascript language from Microsoft.Rapydscript,[20] a translator with a more Pythonic syntaxLiveScriptGorillascript, which offers additional type checking and syntactic sugar for common JS patterns such as inline callbacks
  12. THANKS!!! Not that I'm going to learn flash... or I doubt I will, JAVASCRIPT FOR LIFE!!!
  13. L8V2L

    Help!

    This is an...a(what's the different between a and an?) closure: var createPet = function(name) { var ######; return { setName: function(newName) { name = newName; }, getName: function() { return name; }, getSex: function() { return ######; }, setSex: function(newSex) { if(typeof newSex == "string" && (newSex.toLowerCase() == "male" || newSex.toLowerCase() == "female")) { ###### = newSex; } } } } var pet = createPet("Vivie"); pet.getName(); // Vivie pet.setName("Oliver"); pet.setSex("male"); pet.getSex(); // male pet.getName(); // OliverA closure seem like to me as a variable just grasping the parent function name... I'm guessing the power of this is that as doing so can access into that function by such means as the pet.setName(), mean that if this was a mathematic function, I can gain access through that function as so pet.setName(). In putting any value as I please between the parentheses... So in turn, that would show case it's true power, cause of that fact since I define the parent's function name in pet, by pet grasping it, I can use the variable name pet to access all other sub-level function or child function of the parent function.... If true(and please, despite me typing this, I still would like a more in depth perceptive of this from some one who is a wizard... if that term is not use as I though it was than please excuse mean. When I say wizard, I'm referring to one who is experiences in programming. For I am a novice.)than does this mean by typing pet.setName() I skip the parent function and went to the second level or the first child of the nest function. Same for pet.getSex(); and pet.getName(); Do that mean again, I skip to these nested function, meaning that my value that I set between the parentheses, does not get touch by any of the function that follow it, but not the function that proceed it, so the value is pass through those function? As I said, if this is correct, still please explain to me in your own perceptive, or and the perceptive of the greater practice.
  14. If I only need what a prase function is... feel free not to tell me if you don't want to, for I am sure I will come to pass it in my studies... But it would be nice to have some prior knowledge of it, so when I do come to it, I'll have more of an easier time to gain the concept of it, and it's use.
  15. A function can be recursive; that is, it can call itself. For example, here is a function that computes factorials recursively: function factorial(n){ if ((n == 0) || (n == 1)) return 1; else return (n * factorial(n - 1));}//computing the factorials of one through five as follows:var a, b, c, d, e;a = factorial(1); // a gets the value 1b = factorial(2); // b gets the value 2c = factorial(3); // c gets the value 6d = factorial(4); // d gets the value 24e = factorial(5); // e gets the value 120What make this a recursive function?And how do one distinct such a function from one that is not?And how would one go about to rewrite such a function?My thought on this(and I'm only typing this so you don't think, I'm just coming to you when I don't understand without trying to understand) is that it can call it self(go figure) mean that it does not need console.log to evoke it.(but please explain as if I had not written this, another perceptive can be insightful).
  16. A better understanding of the throw, try, catch, and finally block plus Error constructor, with the 'name' and 'message' property.
  17. I know, ... it just as you all said, the only way to learn this is to play with it, which I'm I see that now(I like to say starting to see since I'm a novice still). You can't teach no one how to code, just the rules, and practices that been displayed over time as away of using the value to communicate to the console.So the return statement acts as a break, ( ; ), and console.log(in the aspect of it print back to the call, the it's value)...SO return cease the function environment after it return a value which the function either alter or just past to the return through the parameter.So return statement return a value to the caller, and cause the interpreter to continue on to the following code.
  18. ... I'm so telling the making of this site you redirect me some where else... AND YOUR A MODERATOR!Have you played the last of us?
  19. // played with it, made retval be a parameter.function test1(retval) { var retval; for (var i = 1; i < 0; i++) { retval *= i; } return retval;}console.log(test1(9));/*P.S. As I was forward deleting in this post, with the del key, it start creating errors in the console.*/
  20. Oh... so returns act as ; for the hold function, stopping it... like a break statement. //What's up with this:var sum = 0;var obj = {prop1: 5, prop2: 13, prop3: 8};for each (var item in obj) { sum += item;}print(sum); // prints "26", which is 5+13+8 // Console keep saying it's missing a ')' function test1() { var retval = 1; for (var i = 1; i < 100; i++) { retval *= i; } return retval;}console.log(test1(1));//return this 9.33262154439441e+155 no matter what number integer I put in.
  21. Yeah, but is that any reason to take the course out?How can I request it back? Mind you I'm not going to learn anytime so unless otherwise, but to have the knowledge available is nice.
  22. Don't tell me you guys believe it too?Who here is a flash developer?What your thought on flash vs html5... even know html5 is still primitive... And I even seen the compares... thought when referring to html5 in this matter, I'm of course speaking on JavaScript.
  23. MUST LEARN JAVASCRIPT! AAWW!!! THE POWER!!!!!!!!!!

  24. function test1() { var retval = 1; return 'test1'; for (var i = 1; i < 100; i++) { retval *= i; } return retval;}// By the look of it, i will increment by 1 until it's 99// retval is the value 1, and will be time by i value// after i under go increment by 1 so... in this sequence retval *=i, it'll go// 1 *= 2, 2*=3, 6*=4, 12*=5, 60*=6, 360*=7, ... and that's all I'm doing by mind// I'm guessing you left out the parameter on purpose, if not, than the code don't // work for I try inputting it (after I figure out what it does of course) in to// the console, as console.log(test1(1)); and it throw or print to the console // test1, put in 2 and it still throw back test1... So I guess I don't know what // it's doing unless you ready did left out a parameter... it also print back undefined//preceding test 1 (above test1)
×
×
  • Create New...