Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

demo files - Day1 Commit #24

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
C:/Users/parit/batch-2/Day4/node_modules
C:/Users/parit/batch-2/project/node_modules
29 changes: 29 additions & 0 deletions Day1/demo1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<body>
<head>
<title></title>
</head>
<script>
let i = 1
const j = 5
let k = "1"
let name = "Paritosh"
let user = {"name" : "Paritosh","age" : 21}
let user2 = {"name" : "user","age": 20}
console.log(i + j)
console.log(i - j)
console.log(i * j)
console.log(i % j)
console.log(i / j)
console.log(i && j)
console.log(i || j)
console.log(i ^ j)
console.log(i / j)
console.log(user == user2)
console.log(user === user2)
console.log(i == k)
console.log(i === k)
</script>
</body>
</html>
Empty file added Day1/demo2.html
Empty file.
Empty file added Day1/demo3.html
Empty file.
13 changes: 13 additions & 0 deletions Day2/demo1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="./demo3.js"></script>
</head>
<body>
<p id = "first">Hello</p>
</body>
</html>
22 changes: 22 additions & 0 deletions Day2/demo1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
for (i = 0;i <= 1000;i++){
console.log("Hello")
}
condition = 1 == 1 ? true : false;
if (condition) {
console.log("After Loop")
}
else {
console.log("It shouldn't be here")
}
marks = 100;
message = "";
if (marks == 100){
message = "Grade A"
}
else if (marks == 90){
message = "Grade B"
}
else {
message = "Grade C"
}
alert(message)
18 changes: 18 additions & 0 deletions Day2/demo2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
min = 1000;
max = 0;
pass = 0;
sum = 0
marks = [100,90,95,99,85];
for (i = 0;i < marks.length;i++){
sum = sum + marks[i];
if (marks[i] > 50){
pass++;
}
min = Math.min(min,marks[i]);
max = Math.max(max,marks[i]);
}
message = pass >= 4 ? "Pass" : "Fail";
console.log(message)
console.log(sum)
console.log(min)
console.log(max)
27 changes: 27 additions & 0 deletions Day2/demo3.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
function demo1(name) {
console.log(`${name} Welcome to the Bootcamp \n Timings 6:30 - 9:30`);
}

function addTwo(i,j){
return i + j;
}

const expression = function addMany() {
sum = 0;
for (i = 0;i < arguments.length;i++){
sum += arguments[i];
}
return sum;
};

console.log(((a,b) => a + b)(2,3));

const arrow = (name) =>{
console.log(`Hello ${name}`);
}

arrow("Paritosh");

demo1("Paritosh");
console.log(addTwo(2,3));
// console.log(addMany(1,2,3,4,5));
13 changes: 13 additions & 0 deletions Day3/demo1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src = "./es6.js"></script>
</head>
<body>

</body>
</html>
15 changes: 15 additions & 0 deletions Day3/es6.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const sum = () => 15;
const addition = (x,y = x * sum()) => x+y;
console.log(sum(),addition(10));

const name = ["Elon","John","Albert"];
console.log(...name);

const i = [1,2,3,4,5]
const j = i
i.push(6)
console.log(j)

const k = new Map();
k.set("users",["user1"]);
console.log(k)
13 changes: 13 additions & 0 deletions Day4/express.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const express = require("express");
const app = express();
app.get("/users/all",(req,res) => {
res.send("Users will be listed here");
})
app.post("/users/create",(req,res) =>{
res.send("User will be created");
})
const server = app.listen(8080,() => {
var host = server.address().address;
var port = server.address().port;
console.log("Running on %s %s",host,port);
})
2 changes: 2 additions & 0 deletions Day4/local.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const log = require("./log.js");
log.info("info");
13 changes: 13 additions & 0 deletions Day4/log.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const log = {
info:(log) => {
console.log("Log " + log);
},
warning: (warning) => {
console.log("Warning " + warning);
},
error: (error) => {
console.log("Error " + error);
}
}

module.exports = log;
20 changes: 20 additions & 0 deletions Day4/mongo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const {MongoClient} = require("mongodb");
const url = "mongodb://localhost:27017/";
const dbname = "sample_db";
MongoClient.connect(url,(error,client) => {
if (!error){
console.log("Connected");
}
else{
console.log("Not Connected");
}
})

// mongo.connect(url,(error,client) => {
// if (!error){
// console.log("Connected");
// }
// else{
// console.log("Not Connected");
// }
// })
12 changes: 12 additions & 0 deletions Day4/node_modules/.bin/mime

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions Day4/node_modules/.bin/mime.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions Day4/node_modules/.bin/mime.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading