Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Keshabkjha committed Aug 31, 2024
1 parent ef90c26 commit a7b51c2
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Programs/Program49.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Example using 'var'
function exampleVar() {
var x = 10;
console.log(x); // Outputs: 10

if (true) {
var x = 20; // Re-declares x
console.log(x); // Outputs: 20
}

console.log(x); // Outputs: 20 (var is function-scoped)
}

exampleVar();
23 changes: 23 additions & 0 deletions Programs/Program50.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Event Example</title>
<script>
function onSelectExample() {
alert('Text has been selected!');
}

function onLoadExample() {
alert('Page has been loaded!');
}
</script>
</head>
<body onload="onLoadExample()">
<h1>Event Example</h1>
<textarea onselect="onSelectExample()" rows="4" cols="50">
Select some text in this area.
</textarea>
</body>
</html>
12 changes: 12 additions & 0 deletions Programs/Program51.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Using array literal
var fruits = ['apple', 'banana', 'cherry'];
console.log(fruits); // Outputs: ['apple', 'banana', 'cherry']
// Using Array constructor
var numbers = new Array(1, 2, 3, 4, 5);
console.log(numbers); // Outputs: [1, 2, 3, 4, 5]
// Using Array instance methods
var moreFruits = new Array();
moreFruits[0] = 'orange';
moreFruits[1] = 'pear';
moreFruits[2] = 'grape';
console.log(moreFruits); // Outputs: ['orange', 'pear', 'grape']
Binary file removed Programs/~$st of programs.docx
Binary file not shown.
Binary file added Study Material/Unit5_Vaishali Mishra.pptx
Binary file not shown.

0 comments on commit a7b51c2

Please sign in to comment.