- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is arguments object in JavaScript?
Arguments object in JavaScript is an object, which represents the arguments to the function executing. Its syntax has two arguments:
[function.]arguments[p]
Example
You can try to run the following code to learn what are arguments object in JavaScript
<html> <body> <script> function functionArgument(val1, val2, val3) { var res = ""; res += "Expected Arguments: " + functionArgument.length; res += "<br />"; res += "Current Arguments : " + arguments.length; res += "<br />"; res += "Each argument = " for (p = 0; p < arguments.length; p++) { res += "<br />"; res += functionArgument.arguments[p]; res += " "; } document.write(res); } functionArgument(20, 50, 80, "Demo Text!","Hello World", new Date()) </script> </body> </html>
Advertisements