@@ -7,20 +7,16 @@ console.log("Hi my name is " +fristname+ ' ' +lastname)
77
88let globalVar = "I am global" ; // Global variable
99
10-
1110// *******************************************************************************************************************
1211
13- /*
1412function example ( ) {
1513 console . log ( globalVar ) ; // ✅ Accessible inside the function
1614}
1715example ( ) ;
1816//console.log(globalVar); // ✅ Accessible outside the function
19- */
2017
2118//********************************************************************************************************************
2219
23- /*
2420//sum of two number
2521let a = 5 ;
2622let b = 6 ;
@@ -29,33 +25,27 @@ function addtwonumber() {
2925 console . log ( "Sum of two number is" , c )
3026}
3127addtwonumber ( ) ;
32- */
3328
3429/* *************************************************************************************************************** */
3530
36- /*
3731//addition of two number
3832function add ( a , b , c ) {
3933 console . log ( "Sum of three number is " , a + b + c )
4034}
4135add ( 3 , 4 , 5 ) ;
42- */
4336
4437// ********************************************************************************************************************
4538
46- /*
4739//example of block scope (let)
4840function username ( ) { //block
4941 let firstname = "shivam"
5042 let lastname = "maurya"
5143 console . log ( "my name is" , firstname , lastname )
5244} //block
5345username ( ) ;
54- */
5546
5647// ********************************************************************************************************************
5748
58- /*
5949//example of function scope (var)
6050function sub ( a , b ) //Called fuction
6151{
@@ -65,11 +55,9 @@ function sub(a, b) //Called fuction
6555 console . log ( "Subtraction of Two number is" , c )
6656}
6757sub ( ) ; // Calling function
68- */
6958
7059// ********************************************************************************************************************
7160
72- /*
7361//Example of block scope (cost)
7462function mul ( ) {
7563 const h = 7
@@ -78,23 +66,19 @@ function mul() {
7866 console . log ( "Multiplication of two digit is" , g )
7967}
8068mul ( )
81- */
8269
8370// ********************************************************************************************************************
8471
85- /*
8672// Example of object
8773let person = {
8874 name : "Alice" , // "name" is the key, "Alice" is the value
8975 age : 25 , // "age" is the key, 25 is the value
9076 isStudent : true // "isStudent" is the key, true is the value
9177} ;
9278console . log ( person . name , person . age , person . isStudent )
93- */
94-
79+
9580// ********************************************************************************************************************
9681
97- /*
9882//Example of Array
9983let ramayana = [ "ram" , "sita" , "lakshman" ] ;
10084console . log ( ramayana ) ;
@@ -105,7 +89,6 @@ console.log(Array.isArray(ramayana));
10589let fruit = [ "mango" , "orange" , "apple" ]
10690console . log ( fruit )
10791console . log ( typeof fruit )
108- */
10992
11093// ********************************************************************************************************************
11194
0 commit comments