SlideShare a Scribd company logo
ARGUMENT
OBJECT IN
JAVASCRIPT
Arguments is an Array-like object accessible
inside functions that contains the values of
the arguments passed to that function.
function getTotalSalary(HRA, basic,
conveyance) {
console.log(arguments[0]);
// Expected Output: 1000
console.log(arguments[1]);
// Expected Output: 7000
console.log(arguments[2]);
// Expected Output: 2000
});
getTotalSalary(1000, 7000, 2000);
● The arguments object is not an Array. It has
none of the Array properties except length.
● It can be converted to an array
var args = Array.prototype.slice.call(arguments);
OR
// Using an array literal is shorter than above
but allocates an empty array
var args = [].slice.call(arguments);
● console.log(typeof arguments) // ‘object’ ;

More Related Content

PPTX
8. Spread Syntax | ES6 | JavaScript
PPTX
7. Rest parameters | ES6 | JavaScript
ODP
Functions & closures
PPTX
1. Arrow Functions | JavaScript | ES6
PDF
Chapter12 array-single-dimension
PPTX
3. Object literals | ES6 | JSON
PPT
Scala in a nutshell by venkat
PPTX
The JavaScript Programming Language
8. Spread Syntax | ES6 | JavaScript
7. Rest parameters | ES6 | JavaScript
Functions & closures
1. Arrow Functions | JavaScript | ES6
Chapter12 array-single-dimension
3. Object literals | ES6 | JSON
Scala in a nutshell by venkat
The JavaScript Programming Language

What's hot (20)

PPTX
Operator overloading
ODP
Functional programming with Scala
PPTX
OPERATOR OVERLOADING IN C++
PPT
C++ overloading
PPTX
Operator overloading and type conversion in cpp
ODP
Pattern Matching - at a glance
PPTX
Reference Parameter, Passing object by reference, constant parameter & Defaul...
PPTX
Operator overloading
 
PPTX
11. Iterators | ES6 | JavaScript | TypeScript
PPTX
Operator Overloading
PDF
JavaScript for ABAP Programmers - 5/7 Functions
PPT
Lec 26.27-operator overloading
PPTX
Operator overloading
PPT
08 c++ Operator Overloading.ppt
PPTX
Operator overloading
PPT
Operator overloading
PPT
Operator Overloading
PPTX
Variadic functions
PPTX
Function overloading
PPT
Lecture5
Operator overloading
Functional programming with Scala
OPERATOR OVERLOADING IN C++
C++ overloading
Operator overloading and type conversion in cpp
Pattern Matching - at a glance
Reference Parameter, Passing object by reference, constant parameter & Defaul...
Operator overloading
 
11. Iterators | ES6 | JavaScript | TypeScript
Operator Overloading
JavaScript for ABAP Programmers - 5/7 Functions
Lec 26.27-operator overloading
Operator overloading
08 c++ Operator Overloading.ppt
Operator overloading
Operator overloading
Operator Overloading
Variadic functions
Function overloading
Lecture5
Ad

More from Ideas2IT Technologies (20)

PDF
Version comaparison in JavaScript
PDF
Currying in JavaScript
PDF
JS Testing Frameworks
PDF
Cool usage of Encoding and Decoding a URI in Javascript
PDF
Iterables and Iterators in JavaScript
PDF
String comparison in javascript
PDF
JavaScript symbols
PDF
Json.parse() in JavaScript
PDF
Bubble sort in Java Script
PDF
Performance analysis in merging arrays - JavaScript
PDF
Nullish coalescing in JavaScript
PDF
Conditionally add keys in JavaScript
PDF
What is Big O in JavaScript - Part-1
PDF
Variable hoisting in JavaScript
PDF
Formidable ES6 spread operator in JavaScript
PDF
Logging in JavaScript - Part-5
PDF
Logging in JavaScript - Part-4
PDF
Logging in JavaScript - Part-3
PDF
Logging in JavaScript - part-2
PDF
Logging in JavaScript - part-1
Version comaparison in JavaScript
Currying in JavaScript
JS Testing Frameworks
Cool usage of Encoding and Decoding a URI in Javascript
Iterables and Iterators in JavaScript
String comparison in javascript
JavaScript symbols
Json.parse() in JavaScript
Bubble sort in Java Script
Performance analysis in merging arrays - JavaScript
Nullish coalescing in JavaScript
Conditionally add keys in JavaScript
What is Big O in JavaScript - Part-1
Variable hoisting in JavaScript
Formidable ES6 spread operator in JavaScript
Logging in JavaScript - Part-5
Logging in JavaScript - Part-4
Logging in JavaScript - Part-3
Logging in JavaScript - part-2
Logging in JavaScript - part-1
Ad

Recently uploaded (20)

PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Nekopoi APK 2025 free lastest update
PPTX
Online Work Permit System for Fast Permit Processing
PDF
Digital Strategies for Manufacturing Companies
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
 
PDF
AI in Product Development-omnex systems
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
System and Network Administration Chapter 2
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
top salesforce developer skills in 2025.pdf
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
L1 - Introduction to python Backend.pptx
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
ISO 45001 Occupational Health and Safety Management System
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Nekopoi APK 2025 free lastest update
Online Work Permit System for Fast Permit Processing
Digital Strategies for Manufacturing Companies
Wondershare Filmora 15 Crack With Activation Key [2025
Odoo POS Development Services by CandidRoot Solutions
VVF-Customer-Presentation2025-Ver1.9.pptx
Navsoft: AI-Powered Business Solutions & Custom Software Development
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
 
AI in Product Development-omnex systems
Odoo Companies in India – Driving Business Transformation.pdf
System and Network Administration Chapter 2
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
top salesforce developer skills in 2025.pdf
Softaken Excel to vCard Converter Software.pdf
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
L1 - Introduction to python Backend.pptx
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
ISO 45001 Occupational Health and Safety Management System

Arguments Object in JavaScript

  • 2. Arguments is an Array-like object accessible inside functions that contains the values of the arguments passed to that function. function getTotalSalary(HRA, basic, conveyance) { console.log(arguments[0]); // Expected Output: 1000 console.log(arguments[1]); // Expected Output: 7000 console.log(arguments[2]); // Expected Output: 2000 }); getTotalSalary(1000, 7000, 2000);
  • 3. ● The arguments object is not an Array. It has none of the Array properties except length. ● It can be converted to an array var args = Array.prototype.slice.call(arguments); OR // Using an array literal is shorter than above but allocates an empty array var args = [].slice.call(arguments); ● console.log(typeof arguments) // ‘object’ ;