Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions array.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//Array
let arr = [2,"xyz",3,"Nadeem",
{
//Inside array we create an object
name : "Muhammad Nadeem",
regNo : "S22BSCS005",
institution : "NetBots",
}
]


console.log(arr);

let arr2 = [1,2,3,4,5]
arr2.push(9) //adding new element in aray using pop
console.log(arr2);

31 changes: 31 additions & 0 deletions first.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
var x = 10;

console.log(x);//Global scope use in anywhere in the program.


let y = 20;

console.log(y);//local scope use in this block.


const z = 30;

console.log(z);//local scope use in this block.


let v;
console.log(v);
//This variable is declared but not assigne vale so this variable type is undefined.

let w = null;
console.log(w);
//This is a variable which initialized by null or assigned null to it so this variable type is null.

let student = {//This is an object variable which store key value pair.
name : "Muhammad Nadeem",
fatherName : "AbluHassan",
age : 22,
city : "skardu",
institution : "NetBots",
}
console.log("Hello my name is " + student.name + " my father Name is " + student.fatherName + " and i am " + student.age + " year old. ");
40 changes: 40 additions & 0 deletions function.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//function which print 0 to any number which you want
console.log("***************************************");
function fun (x){

for(let i=0;i<=x;i++){
console.log(i);
}

}
fun(5);

//function which print even number
console.log("***************************************");

function fun2 (y){
for(let i=0;i<=y;i++){
if(i%2==0){
console.log(i);
}
}

}
fun2(20);

//function which print odd number
console.log("***************************************");

function fun3 (z){
for(let i=0;i<=z;i++){
if(i%2!=0){
console.log(i);
}
}

}
fun3(10);




33 changes: 33 additions & 0 deletions login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>login page</title>
</head>
<body>
<center>
<form style="background-color: black;" height="300px" width="300px">
<h2 style="color: blue;">Facebook login page</h2>
<input type="text" placeholder="Email or Mobile no">
<br><br>
<input type="password" placeholder="password" required>
<br><br>
<button>
<a href="#" style="color: blue;">Login</a>
</button>
<br><br>
<a href="">Forget password</a>
<br><br>
<input type="text" placeholder="Create New Account">

</form>





</center>

</body>
</html>
69 changes: 69 additions & 0 deletions operators.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
//Arthematic operators

let x = 2;
let y = 3;
console.log("x + y = ",x + y);//addition
console.log("x - y = ",x - y);//subtraction
console.log("x * y = ",x * y);//multiplication
console.log("x / y = ",x / y);//division
console.log("x % y = ",x % y);//modules
console.log("x++",x++);//post increment
console.log("--x",--x);//pre increment
console.log("y--",y--);//post decrement
console.log("--y",--y);//pre decrement
console.log((x + y)-(x-y));//grouping

//conditional operators
// 1-

let a = 10;
let b = 20;

if(a==b)
{
console.log("a is equal to b");
}
else if(a>b)
{
console.log("a is greater then b");
}

else (a!=b)
{
console.log("a is greater then b");
}

//logical operators
//1-logical AND
let marks = 75;
if(marks<=100 && marks>=80)
{
console.log("You remarks is grade A+");
}

else if(marks<=79 && marks>=70)
{
console.log("You remarks is grade A");
}

else if(marks<=69 && marks>=60)
{
console.log("You remarks is grade B");
}

else if(marks<=59 && marks>=50)
{
console.log("You remarks is grade B");
}

else
{
console.log("You are failed:");
}







43 changes: 43 additions & 0 deletions practice.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>practice of html</title>
<style>
#box1{
height: 100px;
width: 100px;
background-color: blue;
border: 2px solid black;
text-align: center;
margin: 2px;
display: block;
}
.class1{
height: 100px;
width: 100px;
background-color: blue;
border: 2px solid black;
text-align: center;
margin: 2px;
display: block;


}
</style>
</head>
<body>
<p>This is a three div which have same id:</p>
<div id="box1">box 1</div>
<div id="box1">box 2</div>
<div id="box1">box 3</div>
<br>
<p>This is another three div which have same class name:</p>
<div class="class1">box 1</div>
<div class="class1">box 2</div>
<div class="class1">box 3</div>
<br>

</body>
</html>
37 changes: 37 additions & 0 deletions string-Method.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

//string Methods

console.log("*********************************************************************************");
let name = "Muhammad Nadeem";
console.log("The length of string is : ",name.length);
console.log("The string is convert into uppercase : ",name.toUpperCase());
console.log("The string is convert into uppercase : ",name.toLowerCase());

console.log("*********************************************************************************");
let myName = " my name is muhammad nadeem ";
console.log(myName.trim());//The trim keyword id used to remove white spaces in strat and last of string

//slice
console.log("*********************************************************************************");
let institution = "University of Baltistan";
console.log("Slice is used to cut the string into pieces : ",institution.slice(0,10));

//concat
console.log("*********************************************************************************");
let firstName = "Muhammad Nadeem ";
let lastName = "Momeni";
console.log("concat is used to concatenate two strings : ",firstName.concat(lastName));

//replace
console.log("*********************************************************************************");
let myHobbys = "cricket,football,hockey";
console.log("The replace keyword is used to replace the string : ",myHobbys.replace("football","voleball"));

console.log("*********************************************************************************");

//charAt
let myChar = "I love java script";
console.log("To check which character is at any index : ",myChar.charAt(5));

console.log("*********************************************************************************");

18 changes: 18 additions & 0 deletions variable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
let x = 20;
console.log(x);
x = 30;
console.log(x);

const student = {
name : "Muhammad Nadeem",
regNo : "s22bscs005",
semester : "fifth semester",
section : "A",
session : 2022_2026,

}
console.log(student);
console.log(typeof(student.session))

console.log(student.regNo = 5);
console.log(student);