Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# batch-1
# batch-1
5 changes: 5 additions & 0 deletions daily sessions/Day-01-03Jan22/Task-01/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Task #1
Create a basic HTML page and do the following:
1. Write an inline script
2. Write an internal script
3. Import 1 external Js file
4 changes: 4 additions & 0 deletions daily sessions/Day-01-03Jan22/Task-01/externalJsFile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function myFunction2(){
var name=document.getElementById("name").value;
document.write(name);
}
25 changes: 25 additions & 0 deletions daily sessions/Day-01-03Jan22/Task-01/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!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>Task 1 - D1 - Swiggy i++</title>
</head>
<body>
<!--Internal Js -->
<script>
function myFunction1() {
document.getElementById("demo1").innerHTML="Hey, there ! I have changed. :D";
}
</script>
<!--HTML Code-->
<div id="demo1">Hello World!</div><br>
<button onclick="myFunction1()">Click here to change the above line</button>
<!--External Js-->
<br><br>
Insert input to check the external js function in action :
<script src="externalJsFile.js"></script>
<input id="name" type="text" onchange="myFunction2();"/>
</body>
</html>
25 changes: 25 additions & 0 deletions daily sessions/Day-01-03Jan22/Task-02/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!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>Task 2 - D1 - Swiggy i++</title>
</head>
<body>
<script src="index.js"></script>
<div id="innerHTML">My name will come here, if the below button is clicked.</div><br><br>
1.innerHTML() Function : <button onclick="innerHTML1();">Click here to insert a value using innerHTML
function</button><br><br>
<br>
2.document.write() Function : <input id="documentWrite1" type="text" onchange="documentWrite1();"/>
<br><br>
3.window.alert() Function : <button onclick="alert1();">Click</button>
<br><br>
4.window.print() Function : <button onclick="print1();">Click</button>
<br><br>
5.console.log() Function : <button onclick="log1();">Click</button>
After clicking the button, open Console tab to check the input. :)
<br><br>
</body>
</html>
25 changes: 25 additions & 0 deletions daily sessions/Day-01-03Jan22/Task-02/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
function innerHTML1(){
var name = "Hey, there. It's Ashwin here";
document.getElementById("innerHTML").innerHTML=name;

}
function documentWrite1(){
var name1 = document.getElementById("documentWrite1").value;
document.write(name1);
}

function alert1(){
var name2 = "I have triggered Window.alert() now";
window.alert(name2);
}

function print1() {
var name3 = "I have triggered Window.print() now";
window.print(name3);
}

function log1() {
var name4 = "I have triggered console.log() now";
console.log(name4);

}
44 changes: 44 additions & 0 deletions daily sessions/Day-02-04Jan22/Notes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
### Inline Script:
* Inline scripts cannot be reused.
### Hoisting :
* Hoisting is used for 're-use' of the code.
* Hoisting is Javascript's default behaviour of moving all declarations to the top of the current scope ( to the top of the current script or the current function )
* Hoisting a `let` variable before declaration causes `ReferenceError - Cannog access the let variable before intialization`.
* With `const`, you cant use a variable before it is declared. Error : `Missing initializer in const declaration.`

### Date:

* `const d1 = new Date();`
* `const d2 = new Date(year,month,day,hours,seconds,milliseconds);`
* `cost d3 = new Date(milliseconds);`
* `const d4 = new Date(date string);`

* Month from 0 to 11 (12 will overflow to next Jan)
* Day overflow will spill over to next month
* Using lesser parameters will exclue from the right

### Array:
* Array definition
* Methods
* Sort (string and number) - mynum.sort(function(a,b){return a-b});
* Iterating arrays - forEach()
* toString, pop, push, shift, unshift, splice,concat, slice
* Math.max.apply(null,param) to find max number
* Map(), filter(), reduce() [myfunc(prev,curvalue)],every(),includes(),find(),findIndex()
* from(), keys()

### Sets:

* new Set()
* add()
* delete()
* has()
* forEach()
* values()
* size()
* entries()


## Assignment 1:
1. Modify innerHTML, style.fontSize, style.display, style.visibility,document.getElementById(“test”).value;
2. Array Methods, Objects, Sets and Maps.
Empty file.
24 changes: 24 additions & 0 deletions daily sessions/Day-02-04Jan22/Notes/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//Inline Scripting:

/* Javascript Inline script can be written in this syntax.
<script>
console.log("Hello, World ! ");
</script>
*/

//Hoisting:

// let:
myName = "let-ashwin";
//let myName; - Error : Cannot access 'myName' before initializations.
console.log(myName);
// const:
constName = "const-ashwingopalsamy";
//const constName; - Error: Missing initializer in const declaration.
console.log(constName);

//Date:

function dateFunction() {

}
39 changes: 39 additions & 0 deletions daily sessions/Day-03-05Jan22/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## exports:

* module that can be re-used.

## built in modules:
1. assert
2. buffer
3. child_process
4. cluster
5. crypto
6. dgram
7. dns
8. domain
9. events
10. fs
11. http
12. https
13. net
14. os
15. path
16. punycode
17. querystring
18. readline
19. stream
20. string_decoder
21. timers
22. tls
23. tty
24. url
25. util
26. v8
27. vm
28. zlib


## file system module :
* http, fs, request, response,
* uploadFile - incomingForm

7 changes: 7 additions & 0 deletions daily sessions/Day-03-05Jan22/my-first-page/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var http = require('http');
var dt = require('./myfirstmodule');
http.createServer(function(req,res){
res.writeHead(200,{'Content-Type':'text/html'});
res.write("The date and time are currently "+dt.myDateTime());
res.end();
}).listen(8080);
3 changes: 3 additions & 0 deletions daily sessions/Day-03-05Jan22/my-first-page/myfirstmodule.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
exports.myDateTime = function () {
return Date();
}
9 changes: 9 additions & 0 deletions daily sessions/Day-03-05Jan22/my-fsread-page/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var http = require('http');
var fs = require('fs');
http.createServer(function(req,res){
fs.readFile('hobbies.html',function(err,data){
res.writeHead(200,{'Content-Type':'text/html'});
res.write(data);
return res.end();
});
}).listen(8080);
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added resources/my-form-responses/day3.pdf
Binary file not shown.