-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Sreekar456/main
Added Arrow functions
- Loading branch information
Showing
3 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Mark 2</title> | ||
<link rel="stylesheet" href="style.css" /> | ||
<script src="script.js"></script> | ||
</head> | ||
<body> | ||
<h1>GDSC Web session 2</h1> | ||
<h2>Topic JavaScript</h2> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// classic functions | ||
// declartive functions | ||
// function caclAge(birthYear){ | ||
// var age = 2023 - birthYear; | ||
// return age; | ||
// } | ||
|
||
// const myAge = caclAge(2004); | ||
// // console.log(myAge); | ||
|
||
// // function expressions | ||
// const calcMyAge = caclAge(2004); | ||
// console.log(calcMyAge , myAge); | ||
|
||
// arrow functions () => Special case of function expressions; | ||
|
||
|
||
// const yearsUntillRetirement = (birthYear, firstName) => { | ||
// const Age = 2023 - birthYear; | ||
// const retirement = 70 - Age; | ||
// return `${firstName} will retire in ${retirement} years.`; | ||
// }; | ||
|
||
// console.log(yearsUntillRetirement(1980, "David")); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
body { | ||
font-family: 'Arial', sans-serif; | ||
margin: 20px; | ||
padding: 20px; | ||
text-align: center; | ||
background-color: #176d9f73; | ||
} | ||
|
||
h1 { | ||
color: #333; | ||
} | ||
|
||
h2 { | ||
color: #555; | ||
} |