JavaScript Arguments Object Function Tutorial




Lesson Code: http://www.developphp.com/video/JavaScript/JavaScript-Arguments-Object-Function-Tutorial
In this exercise we explore the Arguments object in JavaScript. Which enables us to create special functions that can intake an undetermined amount of arguments. All of the functions we write, have an arguments object tied to them that we can access.

Original source


25 responses to “JavaScript Arguments Object Function Tutorial”

  1. 1. So when writing a function, when are you supposed to pass in arguments "myFunction(x, y, z) {…}" and when are you supposed to omit them "myFunction() {…}" ?

    2. What do the argument positions represent? i.e if you have "myFunction(x, y, z) { … }", what does the first argument position represent? What does the second argument represent e.t.c. Does it represent an "index" position like loops or something different?
     
    3. Does the order of arguments matter?
    e.g
    function myFunction(x, y, z) {…}
    v.s
    function myFunction(y, z, x) {…}

Leave a Reply