Skip to content

Instantly share code, notes, and snippets.

@appikonda
Last active August 29, 2015 14:04
Show Gist options
  • Save appikonda/a47893a937dea62536c4 to your computer and use it in GitHub Desktop.
Save appikonda/a47893a937dea62536c4 to your computer and use it in GitHub Desktop.
Assignment2.js
// Make this work!
// DO NOT DEFINE ARGUMENTS!!11one
function students() {
console.log("First student name: ");
console.log("Second student name: ");
console.log("Third student name: ");
console.log("Fourth student name: ");
console.log("Number of students: ");
}
students("macha", "bhattu", "jessi", "anoop");
// First student name: macha
// Second student name: bhattu
// Third student name: jessi
// Fourth student name: anoop
// Number of students: 4
function students() {
console.log("First student name: ", arguments[0]);
console.log("Second student name: ", arguments[1] );
console.log("Third student name: ", arguments[2] );
console.log("Fourth student name: ", arguments[3]);
console.log("Number of students: ", arguments.length);
}
@mohnish
Copy link

mohnish commented Jul 21, 2014

Alright, that's the right solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment