-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path18_arrowFunctions.js
97 lines (71 loc) · 1.77 KB
/
18_arrowFunctions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//arrowFunctions
//this
//functions:
// function greetings(name) {
// return "Hey "+ name+ " Good Morning";
// }
// console.log(greetings("yadnyesh"))
//arrow function
// const newFunction=(name) =>{
// console.log(name)
// }
// newFunction("yadneysh");
// const addition = (a,b) => {
// return a + b;
// }
// const sum = addition(10, 20);
// console.log(sum);
//one argument:
// const bookCounter = bookPrice => bookPrice + 7
// const newBookPRice = bookCounter(350);
// console.log(newBookPRice)
//arrow function:
// const arrFun = (favLang,favCar) => {
// const name = "yadnyesh";
// const dob = [17, 9, 2001]
// console.log(name, dob);
// console.log(favLang)
// console.log(favCar[2])
// return name;
// }
// arrFun("javascript",['range rover','wagenor','verna']);
// ***********************************************************************************
//this keyword
// const person = {
// firstName: 'karan',
// lastName: 'rananaware',
// id: 120,
// fullName: function () {
// return this.firstName + " " + this.lastName;
// }
// }
// console.log(person.fullName())
// const bookStore = {
// noOfBooks: 10000,
// address: "sector 12",
// employees: 12,
// bookNames: ['Hellen keller', "Never I have Ever", "MoneyPower"],
// callBook: function () {
// console.log(this)
// }
// }
// bookStore.callBook();
// console.log(this)
// const newFun=()=> {
// const name="yadnyesh"
// }
// newFun();
// "use strict"
// function myFun() {
// return this
// }
// myFun()
// let x = this;
//IIFE
// Immediately Invoked Function Expression
(() => {
console.log("Welcome to the js series");
})();
// function Greet() {
// console.log("Welcome to the js series");
// }()