Skip to content

Commit 0605c33

Browse files
Update JavaScript_Programs.js
1 parent eede388 commit 0605c33

1 file changed

Lines changed: 1 addition & 18 deletions

File tree

JavaScript_Programs.js

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,16 @@ console.log("Hi my name is " +fristname+ ' ' +lastname)
77

88
let globalVar = "I am global"; // Global variable
99

10-
1110
// *******************************************************************************************************************
1211

13-
/*
1412
function example() {
1513
console.log(globalVar); // ✅ Accessible inside the function
1614
}
1715
example();
1816
//console.log(globalVar); // ✅ Accessible outside the function
19-
*/
2017

2118
//********************************************************************************************************************
2219

23-
/*
2420
//sum of two number
2521
let a = 5;
2622
let b = 6;
@@ -29,33 +25,27 @@ function addtwonumber() {
2925
console.log("Sum of two number is", c)
3026
}
3127
addtwonumber();
32-
*/
3328

3429
/* *************************************************************************************************************** */
3530

36-
/*
3731
//addition of two number
3832
function add(a, b, c) {
3933
console.log("Sum of three number is ", a + b + c)
4034
}
4135
add(3, 4, 5);
42-
*/
4336

4437
// ********************************************************************************************************************
4538

46-
/*
4739
//example of block scope (let)
4840
function username() { //block
4941
let firstname = "shivam"
5042
let lastname = "maurya"
5143
console.log("my name is", firstname, lastname)
5244
} //block
5345
username();
54-
*/
5546

5647
// ********************************************************************************************************************
5748

58-
/*
5949
//example of function scope (var)
6050
function 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
}
6757
sub(); // Calling function
68-
*/
6958

7059
// ********************************************************************************************************************
7160

72-
/*
7361
//Example of block scope (cost)
7462
function mul() {
7563
const h = 7
@@ -78,23 +66,19 @@ function mul() {
7866
console.log("Multiplication of two digit is", g)
7967
}
8068
mul()
81-
*/
8269

8370
// ********************************************************************************************************************
8471

85-
/*
8672
// Example of object
8773
let 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
};
9278
console.log(person.name, person.age, person.isStudent)
93-
*/
94-
79+
9580
// ********************************************************************************************************************
9681

97-
/*
9882
//Example of Array
9983
let ramayana = ["ram", "sita", "lakshman"];
10084
console.log(ramayana);
@@ -105,7 +89,6 @@ console.log(Array.isArray(ramayana));
10589
let fruit = ["mango", "orange", "apple"]
10690
console.log(fruit)
10791
console.log(typeof fruit)
108-
*/
10992

11093
// ********************************************************************************************************************
11194

0 commit comments

Comments
 (0)