Jump to content

L8V2L

Members
  • Posts

    788
  • Joined

  • Last visited

Everything posted by L8V2L

  1. Is this a recursive function: function work(){ var x = 5, y = 5; x += y; return(x);};work();
  2. L8V2L

    Help!

    JavaScript ClosuresRemember self-invoking functions? What does this function do? At least it preserves the counter:Example var add = (function () { var counter = 0; return function (x) {return counter += x}}())add(10);add(15);console.log(add(20));// the counter is now 45So this is a self invoking function... is it?
  3. L8V2L

    Help!

    .... Is it invoking it self?Show me one of your drawing!
  4. L8V2L

    Help!

    Is this a recursive function: function work(){ var x = 5, y = 5; x += y; return(x);};work();
  5. L8V2L

    Help!

    I understand that, I'm speak on the array part. What does it mean by array?
  6. L8V2L

    Help!

    A method is a function that is a member of an object. A property is a value or set of values (in the form of an array or object) that is a member of an object.So this is stating that a method is a function belonging to a object(which I understand stand it's the second part that I need more clarity on) and a property is a value or set of value(in the form of an array or object) what do they mean by the second part?
  7. regular JavaScript. The one I been studying.
  8. Is library that write it's snippet into plain JavaScript?
  9. L8V2L

    Help!

    Anonymous Functions//An anonymous function is a function that was declared without any named identifier to refer to it. As such, an anonymous function is usually not accessible after its initial creation.//Anonymous function declarationvar anon = function() { alert('I am anonymous');}; anon();// I understand how to declare an anonymous function.// The most common use for anonymous functions are as arguments to other functions, or as a closure.setTimeout(function() { alert('hello');}, 1000); // Our anonymous function is passed to setTimeout, which will execute the function in 1000 milliseconds.I kinda(wounding mind a refresher on this) understand the anonymous function being use as an argument.(function() { alert('foo');}()); // This is a common method of using an anonymous function as a closure which many javascript frameworks use.I'm lose... I don't understand this technique their using here. //Breakdown of the above anonymous statements://the surrounding braces is a wrapper for the anonymous function//the trailing braces initiates a call to the function and can contain arguments(function(message) { alert(message);}('foo'));// Another way to write the previous example and get the same result/*An alternative representation of the above places the initiating braces to the surrounding braces and not the function itself, which causes confusion over why the surrounding braces are needed in the first place.*/What do they mean by wrapper.. and everything else!?!?(function() { // ...})();Some have even resorted to giving the trailing braces technique derogatory names, in an effort to encourage people to move them back inside of the surrounding braces to where they initiate the function, instead of the surrounding braces.Please break it down for me to understand.
  10. L8V2L

    Help!

    Could you do that again please... But with question, basic question... Foundational JavaScript... sorry if I didn't show the appreciation toward the value of your action, but I need question that I can read and answer, for I'm going through tutorials to try to advance and strength the foundation I'm setting for myself. Such question as what is this, what does this function do, what is this function missing, what is the syntax for a literal array, what is the two ways beside literal to make an array, what is the three ways beside literal to make a function, etc. Could you do such post as this? Please... Could you considerate it... and anyone else who is reading this. Thank you, to those who took the time to read this.
  11. Don't have the money for that... neither my mom, I wish not to trouble her... plus read signature which should direct you to somewhere. It's hard for me to learn in an open environment. Even with this, I get sidetrack like you want believe... I'm doing my best, with what I have to work with; a busted up laptop, and the web.
  12. I'm... happy not the word... excited... but calmly excited of this challenge, and wish you to do more as such in the near future despite my feedback.To answer your question... first it's a basic question. second, there's many ways to say it, it get's overshadow, overwritten. Or to go in detail, the interpreter check the prototype chain to see what property it need to copy from the object's prototype to the instance. If two properties are found in bock the instance and it's object prototype, than the instance property value's override the prototype's value. If just the name of the property, but not the actually value than I thought that the value of the prototype value will get transfer(but as I just try it didn't). I know their are different ways by my post of instancing an object from a object prototype. which is why I ask you to showcase and put a short description by them... or long which ever you want. I'll be thankful either way.
  13. could you write it out and label each one for visual sake... please.
  14. Just my take on JavaScript... and etc... there are question I be asking which aren't question, but more of a... request of opinion/argument.MY OPEINION MATTER YOU DAM DIRTY APES... still haven't finish that movie: rise of the planet of the apes!!!!Okay my first opinion on JavaScript... in this thread a least:I feel as if... mind you, I'm not saying we should change it, but this to me better describe the relationship between the instance of the object's object prototype. with that said, instead of object prototype, it'll be better call object propagate(for the definition feature on http://dictionary.reference.com which state for the third definition: propagate-to transmit(hereditary features or elements)to, or through, offspring.)), instead of prototype, which mean model of for to from when reference to object's object prototype.Any opinions or and arguments?And please correct me on my term use!
  15. Thanks for the short explanation and the links. I read the introduction to the first one, but no more, since I'm concentrating on JavaScript. var foo = {name: "foo", zero: 0, one: 1};var bar = {one: "one", 1: 1};bar.__proto__ = foo; // this./*out put:[object Object] { [functions]: , 1: 1, __proto__: { }, name: "foo", one: "one", zero: 0 }*/var foo = {name:"foo", one: 3, two: 2};var bar = Object.create(foo); // this.bar.two ="two"; bar[2] = 2;console.log(bar);/*output:[object Object] { [functions]: , 2: 2, __proto__: { }, name: "foo", one: 3, two: "two" }*/var foo = {name:"foo", four: 4, five: 5};var bar = foo; // this.bar.four ="four"; bar[5] = 5;console.log(bar);/*output:[object Object] { [functions]: , 5: 5, __proto__: { }, five: 5, four: "four", name: "foo" }*//*Please explain the 'this.', which showcase the different of instance of an object(which to me is copying... or rather inheriting from another object(call the prototype object... or better term object prototype)). Yes, so what's the different in the instance display. and another that is not show case their but is similar in appearance is(var bar = foo()) and bar.[[prototype]] = foo. Please explain.*/
  16. //The following code creates a two-dimensional array.var a = new Array(4);for (i = 0; i < 4; i++) {a[i] = new Array(4);for (j = 0; j < 4; j++) {a[i][j] = "[" + i + "," + j + "]";}}//This example creates an array with the following rows:Row 0: [0,0] [0,1] [0,2] [0,3]Row 1: [1,0] [1,1] [1,2] [1,3]Row 2: [2,0] [2,1] [2,2] [2,3]Row 3: [3,0] [3,1] [3,2] [3,3]//to my understanding an nested array is:var myarray=[[0,1][2,3]];//Looking at the ouput on the console again, I think I understand it:output [object Array][Array[4], Array[4], Array[4], Array[4]]I was speaking on the output. each array is an array that is in another away as a group. array a contain four arrays rows with four in each row.//as so:a=[0,0] [0,1] [0,2] [0,3][1,0] [1,1] [1,2] [1,3][2,0] [2,1] [2,2] [2,3][3,0] [3,1] [3,2] [3,3]]sorry I wasn't clear on my explanation.I have another question: Inheritance and the prototype chainI know that's a chapter of it's on. But if you could give me an short visual explanation, like you di with value and variable reference.<!--ignore-->/*//as invar d = new Date(); // d is a Date objectvar e = d; // e is a reference to an objecte.setDate(10); // e is changed// even though only the e variable was changed, both variables show the same value because e is a reference to dconsole.log(d);console.log(e);var a = 10; // a is set to a scalar valuevar b = a; // the value of a is copied to bb++; // b is changedconsole.log(a); // a stays the same because b is not a reference to aconsole.log(; // b is differentvar function e()*/
  17. L8V2L

    Help!

    Yes, it seem that way. Doing it with the method reduce produce.10, 20->40 [20+20]40, 30->60 [30+30]Thanks for the clarity.
  18. Just another point of view... or maybe quoting my own answer along side your point of view to know that I'm right.
  19. //The following code creates a two-dimensional array.var a = new Array(4);for (i = 0; i < 4; i++) {a[i] = new Array(4);for (j = 0; j < 4; j++) {a[i][j] = "[" + i + "," + j + "]";}}//This example creates an array with the following rows:Row 0: [0,0] [0,1] [0,2] [0,3]Row 1: [1,0] [1,1] [1,2] [1,3]Row 2: [2,0] [2,1] [2,2] [2,3]Row 3: [3,0] [3,1] [3,2] [3,3]//to my understanding an nested array is:var myarray=[[0,1][2,3]];//Looking at the ouput on the console again, I think I understand it:// output [object Array][Array[4], Array[4], Array[4], Array[4]]// but would still like to have someone explain it.// even know I can now guess that each row is referring to an array in a array of arrays..// but still would like to have someone explain it... please.
  20. L8V2L

    Help!

    Thanks justsomeguy for the explanation above. var a = [10, 20, 30];var total = a.reduceRight(function(first, first) { return first + first; });console.log(total); // log 20 Why? I know it have something to do with the nming being //the same, but the math ouput should not be 20.... How? //I look at the reference page they had, and it seem to do what I expect it do.
  21. No face, . Puzzle solving is what programming is about... a least to me. rubes cube we stare at all day while we turn it in our head to find out what side go with what. I have stare at a screen thinking through with the knowledge my novice mind contain from studying to figure out what's wrong with a simple code, until I saw it was missing a ; or typo. You must consume yourself in the life of programming! Remember, the power is yours!(Captain Planet).
  22. Need help understanding the argument object. This is the argument object: arguments[0]? Give a short easy to read and understandable explanation on this please. It doesn't have to be how I describe it, just please give me your take or point to a site that can give me such easy to receive information…. Or both if you can, your take and a site.
×
×
  • Create New...