-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunctions.js
More file actions
50 lines (35 loc) · 1004 Bytes
/
Functions.js
File metadata and controls
50 lines (35 loc) · 1004 Bytes
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
// func declaration
function demo1(name1)// paramter passed normally
{
console.log("this is",name1);
}
demo1("leela")// argument to parameter name1
// function declaration can be hosited and it is dynamic
detail("hello",12,"ckc") // hoisting
function detail(name2,age,native) // paramter passing
{
console.log("this is",name2);
console.log("this is",age); //
console.log("this is",native);
}
detail("reeena",6,"che") // variable passing/input
detail("shalu",10,"villivaklkam")
// func expression means storing function in one varibale
let electronic=function (cost,type) // passing and storing parameter in variable electronic
{
console.log("My Cost is",cost ,"and My Type",type);
}
electronic(300,"Fan")
// arrow function
let movie=(name,ticket,snacks)=>
{
console.log("movie is name is ", name ,"and total cost is",(ticket+snacks));
}
movie("leo",100,100)
//IIFE
//create and execute at same place
(function()
{
console.log("hello");
})
() //