Skip to content

Commit 4d55665

Browse files
committed
Setting up the repo
1 parent b0571d1 commit 4d55665

File tree

5 files changed

+19
-33
lines changed

5 files changed

+19
-33
lines changed

JavaScript_Advance/default_values.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
A JavaScript function can have default parameter value.
3+
Using default function parameters, you can initialize parameters with default values.
4+
If you do not initialize a parameter with some value, then the default value of the parameter is undefined.
5+
*/
6+
17
const helpGST = (name, age) => {
28
console.log(name, age);
39
};
@@ -10,4 +16,14 @@ const helpGSTWithDefaultValues = (name, age = 19) => {
1016

1117
helpGSTWithDefaultValues("Swapnil"); // Output Swapnil 19
1218

13-
helpGSTWithDefaultValues("Vishal", 23); // Output Vishal 23
19+
helpGSTWithDefaultValues("Vishal", 23); // Output Vishal 23
20+
21+
/*
22+
You can also reuse default parameters to set another default parameter.
23+
*/
24+
25+
const addOneToANumberAsDefault = (number1 = 1, number2 = number1 + 8) => {
26+
console.log(number2);
27+
};
28+
29+
addOneToANumberAsDefault(); // Output 9

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This repository was made for beginners to start learning Javascript from Scratch
66

77
This repository uses [Docsify](https://docsify.js.org) for generating documentation website on the fly.
88

9-
if you want run Docsify you must use latest version of node (now is v13.0.1)
9+
If you want run Docsify you must use latest version of node (now is v13.0.1)
1010
read this issue [#299](https://github.com/Swap76/Learn-JavaScript/issues/299)
1111

1212

default_values.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This repository was made for beginners to start learning Javascript from Scratch
66

77
This repository uses [Docsify](https://docsify.js.org) for generating documentation website on the fly.
88

9-
if you want run Docsify you must use latest version of node (now is v13.0.1)
9+
If you want run Docsify you must use latest version of node (now is v13.0.1)
1010
read this issue [#299](https://github.com/Swap76/Learn-JavaScript/issues/299)
1111

1212

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"husky": "^3.0.8"
2121
},
2222
"scripts": {
23-
"test": "echo \"Error: no test specified\" && exit 1",
2423
"lint": "eslint '**/*.js'",
2524
"lint:fix": "eslint '**/*.js' --fix",
2625
"serve-docs": "node ./scripts/build-sidebar.js & docsify serve docs"

0 commit comments

Comments
 (0)