Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Array like object" />
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
/*
Array like object look like array
has index to access elements
has length property
but they do not have array methods
*/
function MyFunction(){
  console.log(arguments.length);
  console.log(arguments);
}
MyFunction("one","two","three");
/*
but we can call array methods explicitly
*/
function MyFunction2(){
  Array.prototype.push.call(arguments, "four");
  console.log(arguments.length);
  console.log(arguments[3]);
}
MyFunction2("one","two","three");
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
deepaksisodiyapro
0viewers