JavaScript Video Tutorial Pt 4

Javascript Video TutorialIn this JavaScript video tutorial I spend some time explaining the complexity of using Arrays and Functions in JavaScript. If you missed part 1, watch that first JavaScript Video Tutorial.

JavaScript Arrays are different from many languages because you can pretty much throw anything in them. This is because JavaScript isn’t strongly typed once again.

JavaScript Functions are also odd because they don’t follow the normal scoping rules used in most other languages. And, did you know you can completely disregard the number of arguments a function will accept? You’ll learn this plus how to:

  • Manipulate Array Data
  • Use Multi-Dimensional Arrays
  • Use the For In Loop
  • Do Awesome Things with the Argument Object

And, much, much more! Like always the code follows the video. If you have any questions, leave them below.

Code From the Video

12 thoughts on “JavaScript Video Tutorial Pt 4”

  1. function addMany(a,b,c,d,e,f) ???

    I really am enjoying your tutorials and am grateful for such an easy way to get up to speed with JavaScript, XML, css, etc.

    On this tutorial about functions, I am glad to learn about this but have one question. I assume that this trick is limited to the number of arguments included in the functioln declaration and more that more arguments (7 or more in our example) could not be passed without a problem. Is this correct?

    Thanks,

    Jerry

    1. I was a bit premature. You covered it immediately after I stopped to ask the question. Sorry and Thanks for your perception of anticipating the question.

      Jerry

      1. No problem. I try to cover everything in the tutorial series. It takes some time to learn how to program. I’m glad you find the videos useful 🙂

  2. Great tutorials,Thank you for the effort
    Confused with part of the code
    In addMany() function ,why the sum is not 0 before the loop
    Thanks

  3. Derek made a mistake because he was super fast at demoing.
    Just set var i = 0; and var sum=0;
    See function below.
    function addMany(a,b,c,d,e,f)
    {
    var i=0;
    var sum=0;
    document.write(“Arguments Length: ” + arguments.length + “”);
    while(i < arguments.length)
    {
    sum = sum + arguments[i];
    i++;
    }

    document.write("Sum of arguments: " + sum + "”);
    }

  4. (function addFunction()
    {var a=document.getElementById(‘hi’).value;
    var b=document.getElementById(‘hii’).value;
    function c(a,b){
    return a+b;}
    }

    +
    =)

Leave a Reply

Your email address will not be published. Required fields are marked *