Skip to content

Instantly share code, notes, and snippets.

@addieljuarez
Created September 13, 2025 19:30
Show Gist options
  • Select an option

  • Save addieljuarez/18e6f535fda17ccbd35833449e8b5930 to your computer and use it in GitHub Desktop.

Select an option

Save addieljuarez/18e6f535fda17ccbd35833449e8b5930 to your computer and use it in GitHub Desktop.
argumentsInFunction.js
function testArguments () {
console.log('--- arguments ---')
console.log(arguments)
for (let i = 0; i < arguments.length; i++) {
console.log(arguments[i])
}
}
testArguments(30, [20, 10], 'numero', { data: 'data' })
// [Arguments] {
// '0': 30,
// '1': [ 20, 10 ],
// '2': 'numero',
// '3': { data: 'data' }
// }
// 30
// [ 20, 10 ]
// numero
// { data: 'data' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment