Jump to content

L8V2L

Members
  • Posts

    788
  • Joined

  • Last visited

Everything posted by L8V2L

  1. L8V2L

    Help!

    Hey guys, I look at this earlier. I understand the math and every thing, but I'm studying... a guide on JavaScript, just concentrating on that... it's more of a dictionary of JavaScript. When I get done with that, I will come back to this, even know I brief over it, and even with davej earlier expression, I understood, but... wanted more than simple explanation.... I don't know.... I just want to know JavaScript. I want to have it as my foundation, as a concrete slab to stand on that way I can have a programming language underneath my built, to which I can go and adventure off to other programming language which JavaScript's components reflects... But really I'm just aiming to know only HTML5 and CC3(Which I will have to go back over it, not cause I don't understanding it, cause their more to it(Which I am fine how things went to me moving on to JavaScript to find out that, those two HTML5 CSS3 can do more than just presentation and documentation, which I know I just want to have a foundation of that to(Which is truth is easier to grasps))) I thank you all for such dedication to all of this... I don't know what you get out of it, and true-fully I don't care. I'm just thankful your hear to help. Thank you all.
  2. L8V2L

    Help!

    //Yes I know. I'm talking about this!1.function sum(levels) {2. if(levels <= 1) {3. return levels;4. } else {5. return levels + sum(levels - 1);6. }7.}8.console.log( sum(4) );Expected ';'// This is straight from the console, copy and paste.
  3. L8V2L

    Help!

    Please! Run your code through a console first!!! I appreciate the walk through and time to write it for me, but syntax error!!!!!!!!And I try to find out where is the error, but I can't. I though it might be do to your first return not having a ; at the end of the statement it return, but that not it... But it is an error the less, for every statement should end with a ; or I'll just be an expression. Why is their a we in there... We would indicate self awareness and plural, more than one. It should be just "have the value of" in my opinion.... Why? Go ask Neo.
  4. L8V2L

    Help!

    function sum(levels) { if(levels == 1) { return levels + 1; } else { return levels + sum(levels - 1); }}/*When I put in 1 it give back two, put in three it give back 7... I can't even guess on if I put in 2, cause the simple fact is I can't see the operation. I understand that:*/function sum(levels) { // that console.log(sum(1)); is the same as var levels = 1; if(levels == 1) { // So if levels === 1 return levels + 1; // it'll add one, and output or console will print out 2. } else { // if levels don't equal 1 or if this was a else if (levels !== 1) return levels + sum(levels - 1); // than.. what? levels add to sum(levels - 1)? } // if I go with that thinking than, putting two in their and it run in their two}// times than levels + sum(1) + levels + sum(1)= 4... I do hope this shows you that I am/* taking this all very serous, despite my hindrance(see signature). And that I do want to learn this. Please, what is the mind set of this, the pattern of thinking. This is appose to imitate human logical to some degree of comprehend.*/ /*The if(levels == 1) Should be if(levels === 1) triple equal sign for the fact that I can simple put in "1" a string value 1, and it will take it, than return it as 11. strangely enough it'll cause the console to return out of stack space, if I do input a string value of 1 in there... You might be thinking what that got to do with what I'm trying to teach you, will if I did not stress on the detail, I could write the same mistake in my program if I don't stricken my JavaScript foundation in the beginning*//*Do you know any material that can help me advance myself in the understanding of this? books, online tutorial, etc. Please, I been non-stop studying JavaScript. Please, I want to release my creativity in this, and make something of myself with this.*/
  5. L8V2L

    Help!

    It's cause stock to over flow.
  6. /*What's the point of the document get??? I put it in the console and it return nothing. It seem like this wasn't a vialed lesson. Unless you wanted me to rewrite it so I'll show me the answer in try it.for example:*/function kryptonite(){var test = 1;document.getElementById('out1').innerHTML = 'test 1'; if(test==='1'){document.getElementById("out1").innerHTML=test;}if(test===1){document.getElementById("out1").innerHTML=test;} }/*That's the only I could have seen the result instead of mixing it up with non related matter as you did... Your like the book I'm reading, keep jumping back and forth from beginner to intermediate.*/
  7. Yes I know... I did already test it out before I posted the reply. Reread it, I post my founding in it. What I was referring to at the end was the return statement.
  8. It comes back undefined, in the IE console. You didn't answer my question about return stamen.
  9. function kryptonite(){var test = 1;document.getElementById('out1').innerHTML = 'test 1';if(test==='1'){return test}document.getElementById('out1').innerHTML += 'test 2';if(test===1){return test}document.getElementById('out1').innerHTML += 'test 3';return 'dog';return 'cat';alert('Done');}/*Comparing test to string 1, number 1... Which it return "test 1" + " test 2", which it shouldn't had for test one, and it's not even under the first if statement... unless it really did just turn in test two, but concatenated with test one by +=... less check by changing test one = with +=. OH YOU TRIED TO TRICK ME!!! .... less just check one more time by just changing the test 2 += to just a =. Yep it does. So it concatenate 'test 1' with 'test 2' ... And I'm guessing if I put the last three items in a console, it will log back 'dog' and 'cat' and alert will popup with the word 'Done'.*/
  10. like a semicolon? Please answer straightforward. but, not all function have them.
  11. From the look of it, a return is when the value is change depending on the function it proceed. What ever operation befall that value, it will be return as the answer, or and out come.
  12. L8V2L

    Help!

    //How is this recursive(repeating over and over)?function power(base, exponent) { if (exponent == 0) return 1; else return base * power(base, exponent - 1);}console.log(power(2, 3));// → 8
  13. That is beginner tutorial, I'm asking question on components of the code, not the actually code. I want to even understand the little of set. Could you give me problems to solve. Like before, but with the statement code you want me to use? So I can have something to go off of.
  14. L8V2L

    Help!

    /*What's the flow here? What's the route that 24 take? When I exchange it for 2 it return null, even know at that point it see if start is greater than goal, which it isn't if goal is 2 and start is 1. Why is that?*/function findSequence(goal) { function find(start, history) { if (start == goal) return history; else if (start > goal) return null; else return find(start + 5, "(" + history + " + 5)") || find(start * 3, "(" + history + " * 3)"); } return find(1, "1");}print(findSequence(24));
  15. L8V2L

    Help!

    /*A stack is when the computer bring with it the memory of where it stop to back track into a code, and so it throw the last code from which cause it to backtrack on top of the code it self to remember that it stop there to go back, and once the code is done being read an computed, it take the memory of where it left off the top of the block of code and resume from that point. Is that correct? So print(chicken()+" came first."); is thrown on top of the function chicken as a bookmark, and ones it's done going through the function, it take the book mark off the top of the function and consume reading from that point?*/ function chicken() { return egg();}function egg() { return chicken();}print(chicken() + " came first.");//And this too:function power(base, exponent){var result = 1;for(var count = 0; count < exponent; count++){result *= base;//}What's the different between putting clury braces bhind this, outputing 1024. And the one underneath?return result;//} Why do result turn 2 when curly braces includ the return result in the for stament.}show(power(2, 10));
  16. /*A stack is when the computer bring with it the memory of where it stop to back track into a code, and so it throw the last code from which cause it to backtrack on top of the code it self to remember that it stop there to go back, and once the code is done being read an computed, it take the memory of where it left off the top of the block of code and resume from that point. Is that correct? So print(chicken()+" came first."); is thrown on top of the function chicken as a bookmark, and ones it's done going through the function, it take the book mark off the top of the function and consume reading from that point?*/ function chicken() { return egg();}function egg() { return chicken();}print(chicken() + " came first.");And this too:function power(base, exponent){var result = 1;for(var count = 0; count < exponent; count++){result *= base;//}What's the different between putting clury braces bhind this, outputing 1024. And the one underneath?return result;//} Why do result turn 2 when curly braces includ the return result in the for stament.}show(power(2, 10)); To get filmier with such with reading a program, I may can't call back the answer that I can't seem to remember of how to put the component together. But working on reading and recognize the code when I see it, will build a database in my memory bank to which when I sit down to write the code, it'll be easier for me to remember. If not that is okay.
  17. I attempt it... I feel as if, it is to earlier for this... Especially with not guide to go by or syntax to work with... This is taking me away from my tutorial. I'm going back to them.If you really want to ask me, See to how good I have gotten to reading code instead of writing it.Give me some code to explain back to you.
  18. <!DOCTYPE html><html><head><meta charset="utf-8"><title>showpower</title><script>window.onerror = function(m, u, l){alert('Javascript Error: '+m+'nURL: '+u+'nLine Number: '+l);return true;}</script><script>function power(base, exponent){var result = 1;for(var count = 0; count < exponent; count++){result *= base;}return result;}//end of functionwindow.onload = function(){str = '';for(var i=0 ; i<12 ; i++){str += '<b>2<sup>'+i+'</sup> = '+ power(2, i) +'</b><br/>';}document.getElementById('out1').innerHTML = str;}//end of function<p><strong>I was right than. You using str to hold an empty string, to which you add into it, even it's self with the += which is str = str +. Like I said, I understand the concept, but putting it in use is another thing. I'm working toward getting a strong foundation of this, learning the building block, really concentrate on the beginner tutorials more than any thing, so I can understand more of it to apply it. I'm still a nob... I'm still not at such at level to compose, only read... But keep challenging me! Even know... Even know it was hard to turn in something, that even I felt I should know how to do, it's good to be challenge against a opponents that you can't beat, but don't give up trying to beat.</strong></p></script></head> What's LT GT? I don't see it. I see open and close bracket.
  19. davej, I was working on another tutorial, which is why I came here for clarity on something, but then I saw your post:function power(base, exponent){var result = 1;for(var count = 0; count < exponent; count++){result *= base;//}What's the different between putting clury braces bhind this, outputing 1024. And the one underneath?return result;//} Why do result turn 2 when curly braces includ the return result in the for stament.}show(power(2, 10));
  20. function power(base, exponent){var result = 1;for(var count = 0; count < exponent; count++){result *= base;//}What's the different between putting clury braces bhind this, outputing 1024. And the one underneath?return result;//} Why do result turn 2 when curly braces includ the return result in the for stament.}show(power(2, 10));I wish I could type, I didn't have to look back, that I did it all from my head. I wish I could tpe it, that it didn't even take me long to do this simple problem... But I did, and it did... I don't care if that referancing is apart of programming, I want to be able to do it straight out my head. I know that comes with time... But that don't change the feeling of defeat. I'm writing this half way... or maybe a quater of the way through, depending on the time it take me to do it, that is.<p>How about writing some code? How about writing an example that accepts six words from a user and then sorts the words and then prints them on the screen?</p><!DOCTYPE html><html><head><meta charset="utf-8"><title>title</title><style>#output1{border:1px dotted #000;min-height:20px;width:300px;}</style><script>/*function btn1(){x=document.getElementById("input1").value;z=document.getElementById("output1");z.innerHTML=x;}<p>this what I had first, before I found the last link</p>function sortNum(a, {return(a- ;}function btn1(x){y=document.input1.value.split(' ') I'm guessing Value is a reserved word. Try to search for it, but found only suggestion toward it. Seeing that it didn't work, I look back over the original code, and saw that value isn't a reserved word but is just referring to the value of the form, which is the inputif(x==0) //if sort alphabetically{y.sort();}else // if sort numerically{y.sort(sortNum);}document.input1.value='';for(i = 0; i < y.length -1; i++){{};}document.input1.value=document.input1.value+y+' ';document.input1.value+=y;[y.length -1] //I'm not advance enough to modify the last reference.*//*I'mma try this way again*///leaving it like this cause of the interest result it gives./*function btn1(){x=document.getElementById("input1").value.split('');x.sort();z=document.getElementById("output1");z.innerHTML=x;} *///Another copy of this to get right to preserved the on above it.function btn1(){x=document.getElementById("input1").value.split(' ');x.sort();z=document.getElementById("output1");z.innerHTML=x;}/*document.getElementById('input1').value='';document.input1.value='';for(i = 0; i < y.length -1; i++){{};}document.getElementById("input1").value=document.getElementById("input1").value+y+' ';document.getElementById("input1").value+=y;[y.length -1]*//*I can't do it, this is as close as I can get it to it.*/function btn1(){x=document.getElementById("input1").value.split(' ');x.sort();z=document.getElementById("output1");z.innerHTML=x;}/*I never said I can apply it, I just understood the concept about it being a empty string to be a place holder to put strings in.*/</script></head><body><h3>Please enter six words one at a time:</h3><input type="text" id="input1"/><input type="button" onclick="btn1()" value="Enter Word"/><h3>Here is the sorted words list:</h3><div id="output1"></div><!--<h3>Here is the sorted words list:</h3><div name="output1"><p>Why changing the number one cause the dotted line dash to disappear?</p></div><p>JavaScript is a language, and like all language. Their many ways to say one thing, but they don't deliver the same way. This deliverance to me is the most important part when programming with JavaScript. I know this isn't the way that you wanted me to do this, which I could have done it with out referring to anything else... But I'm just a nob at this point.</p>-></body></html>referance in order:www.w3Schools.comhttp://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_text_gethttp://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_sort2http://www.javascriptkit.com/javatutors/arraysort4.shtmlP.S: Those sunglasses faces are appose to be b's, I don't know what happen their.I think this: b ) must be what make that face... let's see. .
  21. <script>function myFunction(){var x='',i; //Why this var x = '', i; and not just var x = '', i; I see that the code don't work.for (i=0;i<5;i++){x=x + "The number is " + i + "<br>";}document.getElementById("demo").innerHTML=x;}</script>I was reading that book Eloquent JavaScript, and I came across this again. Well after fiddling with it. I came to the conclusion of that cause x is going to hold the value of which the statement produce, so it need the right... How to put it... area to store it in, which in term is this '' or this "". And so that is why x is equal assign to that. Thanks for your help with it... I figure it's only right of me to report this to you. Cause I came to the realization of this due to the fact of reading the book you brought back in to my mind towards. Cause of your consideration, which cause me to reconsider reading it, is why I came to the clarity of this. In hindsight, your statement or better yet, explanation makes sense to me, to which the concept that it describe.Thanks justsomeguy, for just some guy, you are okay by me. Here's a cookie.(warm smile toward justsomeguy) COOKIE!!!!!!!!(crazy stare at justsomeguy) COOKIE!!!!!! COOKIE!!!!!!!!!! and milk...(a calm warm smile toward justsomeguy) ENJOY!!!!!(back to the crazy stare)
  22. Learning and improving my knowledge on JavaScript! And working toward having a strong foundation of understanding and knowledge of it.

  23. THANKS JUSTSOMEGUY, YOU MAY BE JUST SOME GUY, BUT YOU THE GUY! Thank you for such the detail reply, I enjoy with excitement reading what you wrote... Don't think cause your amazing... Which you are but that's not why. I want to understand, I want to know, jQuery seem awesome, but to my prospective, it's more of a child or a some what short cut way to writing JavaScript. And I don't want that, I want to learn JavaScript, if I need to use such framework, I want to use them, after I understand JavaScript foundation, and intermediate, to where I can just going into advance. So if I ever need to use such frameworks, I want to do so cause I don't really feel like typing up something I could just copy and paste... Which will be NEVER!!!! The only thing closely to copy and paste I'll do, is use it as a guide to rewrite it as of how I want it to look and act. JavaScript is a language, and as all other language program coded and non-coded, there is many ways to say one thing, but not entirely true, for how it couvade when said. So... Yeah!!!!Thanks!!!!!! Appreciate it, as always!Here something you might like to watch, very educational and insightful:
×
×
  • Create New...