Skip to content

Commit e788693

Browse files
author
ashfaq
committedNov 30, 2018
collection and argument
1 parent ee24366 commit e788693

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed
 

‎arguments.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
3+
function printUserDetails(firstName, lastName, mobile){
4+
console.log(`\n\n`);
5+
console.log(`firstName: ${firstName}`)
6+
console.log(`lastName: ${lastName}`)
7+
console.log(`mobile: ${mobile}`)
8+
console.log(`length: ${arguments.length}`);
9+
console.log(`arguments ${JSON.stringify(arguments)}`)
10+
}
11+
12+
printUserDetails();
13+
printUserDetails('ashfaq');
14+
15+
function printUserDetailsWithDefault({firstName="Mohammed", lastName="ansari", mobile=94899978789789}={}){
16+
console.log(`\n\n`);
17+
console.log(`firstName: ${firstName}`)
18+
console.log(`lastName: ${lastName}`)
19+
console.log(`mobile: ${mobile}`)
20+
}
21+
22+
printUserDetailsWithDefault();
23+
printUserDetailsWithDefault({firstName:'ashfaq'});
24+
printUserDetailsWithDefault({lastName:'ANSARI'});
25+
printUserDetailsWithDefault({mobile:91281982091});
26+

‎collection.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
let collection =[
2+
1,
3+
false,
4+
{
5+
name: "Ashfaq",
6+
address: "kalajyothi kondapur",
7+
},
8+
function({name, address}={}){
9+
console.log(`name: ${name}`);
10+
console.log(`address: ${address}`);
11+
}
12+
]
13+
14+
15+
collection[3](collection[2]);

‎index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<html>
2+
<head>
3+
4+
</head>
5+
<body>
6+
<meta charset="utf-8"/>
7+
8+
<!-- <script src="collection.js"></script> -->
9+
<script src="arguments.js"></script>
10+
</body>
11+
</html>

0 commit comments

Comments
 (0)
Please sign in to comment.