Article in HTML
+Google Chrome
+Google Chrome is a web browser developed by Google, released in 2008. Chrome is the world's most popular web browser today!
+diff --git a/New Text Document.txt b/New Text Document.txt new file mode 100644 index 00000000..728a835f --- /dev/null +++ b/New Text Document.txt @@ -0,0 +1,13 @@ +Windows PowerShell +Copyright (C) 2015 Microsoft Corporation. All rights reserved. + +PS E:\Mernstack\Web-Dev-Batch-1> git pull +remote: Enumerating objects: 8, done. +remote: Counting objects: 100% (8/8), done. +remote: Compressing objects: 100% (8/8), done. +error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 0 +error: 2551 bytes of body are still expected +fetch-pack: unexpected disconnect while reading sideband packet +fatal: early EOF +fatal: unpack-objects failed +PS E:\Mernstack\Web-Dev-Batch-1> \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 04f5d024..00000000 --- a/README.md +++ /dev/null @@ -1 +0,0 @@ -# Osama diff --git a/asyn.js b/asyn.js new file mode 100644 index 00000000..96a10aaa --- /dev/null +++ b/asyn.js @@ -0,0 +1,52 @@ +// const getData1 = async () => { +// let data = "Hello World"; +// return data; +// } + +// getData1().then(data => console.log(data)); + +////////////////////////////////////////// +// const getData2 = async () => { +// let y = await "Hello World"; +// console.log(y); +// } + +// console.log(1); +// getData2(); +// console.log(2); +//////////////////////////////////////////////// + +// async function test() { + +// await console.log("A"); +// console.log("B"); +// await console.log("C"); + + +// } + +// console.log(" hello") +// test() + + +function asynchronous_operational_method() { + let first_promise = new Promise((resolve, reject) => resolve("Hello")); + + let second_promise = new Promise((resolve, reject) => { + setTimeout(() => { + resolve(" GeeksforGeeks.."); + }, 1000); + }); + + let combined_promise = Promise.all([first_promise, second_promise]); + return combined_promise; +} + +async function display() { + let data = await asynchronous_operational_method(); + console.log(data); +} + + + +display(); \ No newline at end of file diff --git a/cond.js b/cond.js new file mode 100644 index 00000000..1dc5d1fe --- /dev/null +++ b/cond.js @@ -0,0 +1,31 @@ + var hour=19 + +if (hour < 18) { + greeting = "Good day"; + console.log(greeting) + + } + else { + greeting = "Good evening"; + console.log(greeting) + } + let time=15; + + if (time < 10) { + greeting = "Good morning"; + console.log(greeting) + } + else if (time < 20) + { + greeting = "Good day"; + console.log(greeting) + } + else if (time = 15) + { + greeting = "Good half day"; + console.log(greeting) + } + + else { + greeting = "Good evening"; + } diff --git a/css_practice3.html b/css_practice3.html new file mode 100644 index 00000000..6c69b80e --- /dev/null +++ b/css_practice3.html @@ -0,0 +1,165 @@ + + +
+ +
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu sem tempor, varius quam at, luctus dui. Mauris magna metus, dapibus nec turpis vel, semper malesuada ante. Vestibulum id metus ac nisl bibendum scelerisque non non purus. Suspendisse varius nibh non aliquet sagittis. In tincidunt orci sit amet elementum vestibulum. Vivamus fermentum in arcu in aliquam. Quisque aliquam porta odio in fringilla. Vivamus nisl leo, blandit at bibendum eu, tristique eget risus. Integer aliquet quam ut elit suscipit, id interdum neque porttitor. Integer faucibus ligula.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu sem tempor, varius quam at, luctus dui. Mauris magna metus, dapibus nec turpis vel, semper malesuada ante. Vestibulum id metus ac nisl bibendum scelerisque non non purus. Suspendisse varius nibh non aliquet sagittis. In tincidunt orci sit amet elementum vestibulum. Vivamus fermentum in arcu in aliquam. Quisque aliquam porta odio in fringilla. Vivamus nisl leo, blandit at bibendum eu, tristique eget risus. Integer aliquet quam ut elit suscipit, id interdum neque porttitor. Integer faucibus ligula.
+Quis quam ut magna consequat faucibus. Pellentesque eget nisi a mi suscipit tincidunt. Ut tempus dictum risus. Pellentesque viverra sagittis quam at mattis. Suspendisse potenti. Aliquam sit amet gravida nibh, facilisis gravida odio. Phasellus auctor velit at lacus blandit, commodo iaculis justo viverra. Etiam vitae est arcu. Mauris vel congue dolor. Aliquam eget mi mi. Fusce quam tortor, commodo ac dui quis, bibendum viverra erat. Maecenas mattis lectus enim, quis tincidunt dui molestie euismod. Curabitur et diam tristique, accumsan nunc eu.
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu sem tempor, varius quam at, luctus dui. Mauris magna metus, dapibus nec turpis vel, semper malesuada ante. Vestibulum id metus ac nisl bibendum scelerisque non non purus. Suspendisse varius nibh non aliquet sagittis.
+ + + + + + + + +Visit www.tutorialrepublic.com
+ + + + \ No newline at end of file diff --git a/destructre.js b/destructre.js new file mode 100644 index 00000000..34ac2c9f --- /dev/null +++ b/destructre.js @@ -0,0 +1,16 @@ +let a, b, rest; +[a, b] = [10, 20]; + +console.log(a); +// Expected output: 10 + +console.log(b); +// Expected output: 20 + +[a, b, ...rest] = [10, 20, 30, 40, 50]; + + +console.log(rest); +// Expected output: Array [30, 40, 50] + + diff --git a/foreach.js b/foreach.js new file mode 100644 index 00000000..38b95d66 --- /dev/null +++ b/foreach.js @@ -0,0 +1,27 @@ +// JavaScript to illustrate forEach() method +function func() { + + // Original array + const items = [12, 24, 36]; + const copy = []; + items.forEach(function (item) { + copy.push(item + item + 2); + }); + console.log(copy); + } + func(); + + + // JavaScript to illustrate forEach() method +function func() { + + // Original array + const items = [1, 4, 6]; + const copy = []; + items.forEach(function (item) { + copy.push(item * item); + }); + console.log(copy); + } + func(); + \ No newline at end of file diff --git a/fun.js b/fun.js new file mode 100644 index 00000000..a40b6e76 --- /dev/null +++ b/fun.js @@ -0,0 +1,62 @@ + +let hello=function(){ + console.log(" hello"); +} + +hello() + + + +//////add func //////////////// +function add(x,y) +{ + return(x+y) +} + +a=add(3,4) +console.log(a) + +//////sub function ///////////// +function sub(a,b) +{ + return(a-b) +} + +b=sub(8,9) +console.log(b) + +//////////////mul////// + +function mul(x,y,z) +{ + return(x*y*z) +} + +mul(2*3*4) + //////////// + + function add1(x,y) + { + console.log(x*y) + } + + add1(20,20) + +let add2=function(a,b) +{ + console.log(a+b) +} +add2(1,2) + +let add3=(x,y)=> +{ +console.log(x,y) +} +add3(80,90) + +const cars = new Array("Saab", "Volvo", "BMW"); +console.log(cars) + +const person = ["John", "Doe", 46]; +console.log(person) + diff --git a/function.js b/function.js new file mode 100644 index 00000000..1cc53ae4 --- /dev/null +++ b/function.js @@ -0,0 +1,51 @@ + +//////add func //////////////// +function add(x,y) +{ + return(x+y) +} + +a=add(3,4) +console.log(a) + +//////sub function ///////////// +function sub(a,b) +{ + return(a-b) +} + +b=sub(8,9) +console.log(b) + +//////////////mul////// + +function mul(x,y,z) +{ + return(x*y*z) +} +c=mul(2,3,4) +console.log(c) + + +// Function is called, the return value will end up in x +let x = myFunction(8, 3); + +function myFunction(a, b) { +// Function returns the product of a and b + return a * b; +} + +console.log(x) + +// Arrow function +//const multiply = (x, y) => x * y; + +//console.log(multiply) +//multiply(5,6) + + +let hello=function(){ + console.log(" hello"); +} + +hello() diff --git a/html_css_practice .html b/html_css_practice .html new file mode 100644 index 00000000..9a86783f --- /dev/null +++ b/html_css_practice .html @@ -0,0 +1,409 @@ + + + + + + + +The background-attachment property specifies whether the background image should scroll or be fixed (will not scroll with the rest of the page).
+ +Tip: If you do not see any scrollbars, try to resize the browser window.
+ +The background-image is fixed. Try to scroll down the page.
+The background-image is fixed. Try to scroll down the page.
+The background-image is fixed. Try to scroll down the page.
+The background-image is fixed. Try to scroll down the page.
+The background-image is fixed. Try to scroll down the page.
+The background-image is fixed. Try to scroll down the page.
+The background-image is fixed. Try to scroll down the page.
+The background-image is fixed. Try to scroll down the page.
+The background-image is fixed. Try to scroll down the page.
+ + + + + + + + + +This property specifies what kind of border to display:
+ +A dotted border.
+A dashed border.
+A solid border.
+A double border.
+A groove border.
+A ridge border.
+An inset border.
+An outset border.
+No border.
+A hidden border.
+A mixed border.
+ + + + + + + + + + + + + + + +This property specifies the color of the four borders:
+ +A solid red border
+A solid green border
+A dotted blue border
+ +Note: The "border-color" property does not work if it is used alone. Use the "border-style" property to set the borders first.
+ + + + + + + + + + + + +This property is used to add rounded borders to an element:
+ +Normal border
+Round border
+Rounder border
+Roundest border
+ + + + + + + + + + + + +The CSS box model is essentially a box that wraps around every HTML element. It consists of: borders, padding, margins, and the actual content.
+ +The three headings above are aligned center, left and right.
+ + + + + + + + +Some Font Awesome icons:
+ + + + + + +Styled Font Awesome icons (size and color):
+ + + + + + + + + + + + + + + + +A responsive table will display a horizontal scroll bar if the screen is too +small to display the full content. Resize the browser window to see the effect:
+To create a responsive table, add a container element (like div) with overflow-x:auto around the table element:
+ +| First Name | +Last Name | +Points | +Points | +Points | +Points | +Points | +Points | +Points | +Points | +Points | +Points | +
|---|---|---|---|---|---|---|---|---|---|---|---|
| Jill | +Smith | +50 | +50 | +50 | +50 | +50 | +50 | +50 | +50 | +50 | +50 | +
| Eve | +Jackson | +94 | +94 | +94 | +94 | +94 | +94 | +94 | +94 | +94 | +94 | +
| Adam | +Johnson | +67 | +67 | +67 | +67 | +67 | +67 | +67 | +67 | +67 | +67 | +
JavaScript has dynamic types. This means that the same variable can be used to hold different data types:
+ + + + + + + + + + + + + +You can use quotes inside a string, as long as they don't match the quotes surrounding the string:
+ + + + + + + + + + + + + +Numbers can be written with, or without decimals:
+ + + + + + + + + + + + +A BigInt can not have decimals.
+ + + +You cannot perform math between a BigInt type and a Number type.
+ + + + + + + + +Array indexes are zero-based, which means the first item is [0].
+ + + + + + + + + + + + +The typeof operator returns the type of a variable or an expression.
+ + + + + + + + + + + + + + + + + +Call a function which performs a calculation and returns the result:
+ + + + + + + + + + + + + + +Using a function as a variable:
+ + + + + + + + + + + + + +If you access an object method without (), it will return the function definition:
+ + + + + + + + + + + + + +The sliced (extracted) part of the string is:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jsarray.js b/jsarray.js new file mode 100644 index 00000000..bd47647e --- /dev/null +++ b/jsarray.js @@ -0,0 +1,102 @@ +// Create and initialize an array +let courses = ["HTML", "CSS", "JavaScript", "React"]; + +// Display the array items +console.log(courses); + +// Create a new empty array +let newArray = []; + +// forEach loop to push elements +// into new array +courses.forEach(function (course) { + newArray.push(course); +}); + +// Display the new array of items +console.log(newArray); + +// Using elements +const array1 = new Array(1, 2, 3, 4, 5) + +// Using arrayLength +const array2 = new Array(10) + +console.log(array1); +console.log(array2) + +let arr = new Array("Geeks", "for", "Geeks"); +console.log("arr.length:" + arr.length); + +//// return array object +let myArr = Array.from("45878965412365"); +console.log(myArr); + + // Here the Array.of() method creates a new Array instance with + // a variable number of arguments, regardless of + // number or type of the arguments. + console.log(Array.of(0, 0, 0)); + console.log(Array.of(11, 21, 33)); + console.log(Array.of("Ram","Geeta")); + console.log(Array.of('geeksforgeeks')); + console.log(Array.of(2,3,4,'Sheeta')); + + const arr1 = [45, 32, 69, 21]; + const index = 3; + + console.log(arr1.at(index)); + + // JavaScript code for concat() method +function func() { + let num1 = [11, 12, 13], + num2 = [14, 15, 16], + num3 = [17, 18, 19]; + console.log(num1.concat(num2, num3)); +} +func(); + +// Input array +let array = [1, 2, 3, 4, 5, 6, 7]; + +// placing at index position 0 the element +// between index 3 and 6 +console.log("Array " + array.copyWithin(0, 3, 6)); + + +// JavaScript code for every() method +function isEven(element, index, array) { + return element % 2 === 0; +} +function func() { + let arr = [56, 92, 18, 88, 12]; + + // Check for even number + let value = arr.every(isEven); + console.log(value); +} +func(); + + +// input array contain some elements. +let array3 = [1, 2, 3, 4]; + +// Here array.fill function fills with 0 +// from position 2 till position 3. +console.log(array3.fill(0, 2, 4)); + +// input array contain some elements. +let array4 = [1, 2, 3, 4]; + +// Here array.fill function fills with 0 +// from position 2 till position 3. +console.log(array4.fill(0, 2, 4)); +// JavaScript to illustrate findIndex() method +function canVote(age) { + return age >= 18; +} + +function func() { + let filtered = [24, 33, 16, 40].filter(canVote); + console.log(filtered); +} +func(); diff --git a/mapfunc.js b/mapfunc.js new file mode 100644 index 00000000..4e039c32 --- /dev/null +++ b/mapfunc.js @@ -0,0 +1,16 @@ +const numbers = [2, 4, 6, 8, 10]; +const squareRoots = numbers.map(num => Math.sqrt(num)); + +console.log(squareRoots); // Output: [1, 2, 3, 4, 5] + + +// Input array +let arr = [4, 5, 6, 7, 8, 10]; + +// Using map to transform elements +let newArr = arr.map(function (val, index) { + return { key: index, value: val * val }; +}) + +// Display output +console.log(newArr) diff --git a/newFile.js b/newFile.js new file mode 100644 index 00000000..d6e2f8fb --- /dev/null +++ b/newFile.js @@ -0,0 +1,9 @@ +; diff --git a/obj.js b/obj.js new file mode 100644 index 00000000..55350c15 --- /dev/null +++ b/obj.js @@ -0,0 +1,14 @@ + +let detail={ + + title:"Mern stack", + auther:"sqlain", + + + } + + let {title:coursetitle, auther:name}=detail + + + console.log(coursetitle) + console.log(name) \ No newline at end of file diff --git a/objectmethods.js b/objectmethods.js new file mode 100644 index 00000000..86519942 --- /dev/null +++ b/objectmethods.js @@ -0,0 +1,107 @@ +// Initialize an object with properties and methods +const job = { + position: 'cashier', + type: 'hourly', + isAvailable: true, + showDetails() { + const accepting = this.isAvailable ? 'is accepting applications' : "is not currently accepting applications"; + + console.log(`The ${this.position} position is ${this.type} and ${accepting}.`); + } +}; + +// Use Object.create to pass properties +const barista = Object.create(job); + +barista.position = "barista"; +barista.showDetails(); + + +// Initialize an object +const employees = { + boss: 'Michael', + secretary: 'Pam', + sales: 'Jim', + accountant: 'Oscar' +}; + +// Get the keys of the object +const keys = Object.keys(employees); + +console.log(keys); + + + +// Initialize an object +const session = { + id: 1, + time: `26-July-2018`, + device: 'mobile', + browser: 'Chrome' +}; + +// Get all values of the object +const values = Object.values(session); + +console.log(values); + +// Initialize an object +const operatingSystem = { + name: 'Ubuntu', + version: 18.04, + license: 'Open Source' +}; + +// Get the object key/value pairs +const entries = Object.entries(operatingSystem); + +console.log(entries); + + + +// Initialize an object +const name = { + firstName: 'Philip', + lastName: 'Fry' +}; + +// Initialize another object +const details = { + job: 'Delivery Boy', + employer: 'Planet Express' +}; + +// Merge the objects +const character = Object.assign(name, details); + +console.log(character); + + +// Initialize an object +const user = { + username: 'AzureDiamond', + password: 'hunter2' +}; + +// Freeze the object +const newUser = Object.freeze(user); + +newUser.password = 'skardu'; +newUser.active = true; + +console.log(newUser); + + +// Initialize an object +const user1 = { + username: 'AzureDiamond', + password: 'hunter2' +}; + +// Seal the object +const newUser1 = Object.seal(user1); + +newUser1.password = 'india'; +newUser1.active = true; + +console.log(newUser1); \ No newline at end of file diff --git a/p1.html b/p1.html new file mode 100644 index 00000000..e03a2df7 --- /dev/null +++ b/p1.html @@ -0,0 +1,116 @@ + + + + +The World Wide Fund for Nature (WWF) is an international organization working on issues regarding the conservation, research and restoration of the environment, formerly named the World Wildlife Fund. WWF was founded in 1961.
+The Panda has become the symbol of WWF. The well-known panda logo of WWF originated from a panda named Chi Chi that was transferred from the Beijing Zoo to the London Zoo in the same year of the establishment of WWF.
+The Panda has become the symbol of WWF. The well-known panda logo of WWF originated from a panda named Chi Chi that was transferred from the Beijing Zoo to the London Zoo in the same year of the establishment of WWF.
+Google Chrome is a web browser developed by Google, released in 2008. Chrome is the world's most popular web browser today!
+Mozilla Firefox is an open-source web browser developed by Mozilla. Firefox has been the second most popular web browser since January, 2018.
+Microsoft Edge is a web browser developed by Microsoft, released in 2015. Microsoft Edge replaced Internet Explorer.
+WWF's mission:
+WWF's mission is to stop the degradation of our planet's natural environment, + and build a future in which humans live in harmony with nature.
+My family and I visited The Epcot center this summer. The weather was nice, and Epcot was amazing! I had a great summer together with my family!
+ + + +My family and I visited The Epcot center this summer. The weather was nice, and Epcot was amazing! I had a great summer together with my family!
+My family and I visited The Epcot center this summer. The weather was nice, and Epcot was amazing! I had a great summer together with my family!
+ + + +Epcot is a theme park at Walt Disney World Resort featuring exciting attractions, international pavilions, award-winning fireworks and seasonal special events.
+Resize this responsive page!
+London is the capital city of England.
+It is the most populous city in the United Kingdom, + with a metropolitan area of over 13 million inhabitants.
+Paris is the capital of France.
+The Paris area is one of the largest population centers in Europe, + with more than 12 million inhabitants.
+Tokyo is the capital of Japan.
+It is the center of the Greater Tokyo Area, + and the most populous metropolitan area in the world.
+