Skip to content

Commit 3bf523f

Browse files
committed
config function
1 parent 9e99a04 commit 3bf523f

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

js_basics/functions.js

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
//function defination
2+
// function myname(){
3+
// console.log("K");
4+
// console.log("R");
5+
// console.log("I");
6+
// console.log("S");
7+
// console.log("H");
8+
// }
9+
10+
//function call
11+
// myname();
12+
13+
// function addTwoNum(num1,num2){
14+
// console.log(num1+num2);
15+
// }
16+
// function addTwoNum(num1,num2){
17+
// let result = num1+num2;
18+
// return result;
19+
// }
20+
// const addfun = addTwoNum(2,56);
21+
// console.log(addfun);
22+
23+
// function loginusermsg(username="uma"){
24+
// if(!username){
25+
// console.log("please fill the details");
26+
// return;
27+
// }
28+
// console.log(`${username} logged in`);
29+
// }
30+
// console.log(loginusermsg());
31+
32+
33+
34+
///next function video
35+
//use rest operator when ever a use user add to cart so can't how much product add into an cart so calculare to price is a big problem so we use here rest operstor ... that is add into an array all value
36+
// function calculateCartPrice(...num){
37+
// return num;
38+
// }
39+
// console.log(calculateCartPrice(55,63,53,75,7896,522));
40+
41+
42+
//lets talk about function with object
43+
// const user = {
44+
// name : "krish",
45+
// price:85
46+
// }
47+
48+
// function funwithobject(anyobject){
49+
// console.log(`hii ${anyobject.name} and your price is ${anyobject.price}`);
50+
// }
51+
// funwithobject(user);
52+
53+
54+
// lets talk about functions with array
55+
// const user = ["krish","heena","rahul","abhi"];
56+
// function functionwitharray(anyarray){
57+
// console.log(anyarray[1]);
58+
// }
59+
// functionwitharray(user);

0 commit comments

Comments
 (0)