-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8beacbe
commit 83f26b1
Showing
11 changed files
with
178 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
15 - 20.12.23 - Modules/modules/modules_0/array_utilities.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const name = 'Tomer Sagi'; | ||
const age = 44; | ||
|
||
function printArray(arr) { | ||
for (let i=0 ; i<arr.length ; i++) { | ||
document.getElementById('output').innerHTML += `${i}. ${arr[i]}<br/>`; | ||
} | ||
} | ||
|
||
export { | ||
name, | ||
printArray | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>19.11.23</title> | ||
<script defer type="module" src="./main.js"></script> | ||
</head> | ||
<body> | ||
<h1>17.12.23</h1> | ||
<h2>Fetch</h2> | ||
|
||
<div id="buttons"> | ||
<button id="btnLoad">Start</button> | ||
</div> | ||
|
||
<hr/> | ||
|
||
<div id="output"> | ||
<table id='myTable'> | ||
|
||
</table> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { printArray } from 'array_utilities.js'; | ||
|
||
const myArr = ['Tomer', 'Gal', 'Moshe', 'Sahar']; | ||
printArray(myArr); | ||
|
||
// alert(`Name: ${name}`); |
8 changes: 8 additions & 0 deletions
8
15 - 20.12.23 - Modules/modules/modules_1_inline_export/array_utilities.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const name = 'Tomer Sagi'; | ||
const age = 44; | ||
|
||
export function printArray(arr) { | ||
for (let i=0 ; i<arr.length ; i++) { | ||
document.getElementById('output').innerHTML += `${i}. ${arr[i]}<br/>`; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
15 - 20.12.23 - Modules/modules/modules_1_inline_export/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>19.11.23</title> | ||
<script defer type="module" src="./main.js"></script> | ||
</head> | ||
<body> | ||
<h1>17.12.23</h1> | ||
<h2>Fetch</h2> | ||
|
||
<div id="buttons"> | ||
<button id="btnLoad">Start</button> | ||
</div> | ||
|
||
<hr/> | ||
|
||
<div id="output"> | ||
<table id='myTable'> | ||
|
||
</table> | ||
</div> | ||
</body> | ||
</html> |
6 changes: 6 additions & 0 deletions
6
15 - 20.12.23 - Modules/modules/modules_1_inline_export/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { printArray } from './array_utilities.js'; | ||
|
||
const myArr = ['Tomer', 'Gal', 'Moshe', 'Sahar']; | ||
printArray(myArr); | ||
|
||
// alert(`Name: ${name}`); |
11 changes: 11 additions & 0 deletions
11
15 - 20.12.23 - Modules/modules/modules_2_default/array_utilities.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export const name = 'Tomer Sagi'; | ||
const age = 44; | ||
|
||
// Expects a JS Array, iterates over it and prints every element to a DIV using 'innerHTML' | ||
function printArray(arr) { | ||
for (let i=0 ; i<arr.length ; i++) { | ||
document.getElementById('output').innerHTML += `${i}. ${arr[i]}<br/>`; | ||
} | ||
} | ||
|
||
export default printArray; |
25 changes: 25 additions & 0 deletions
25
15 - 20.12.23 - Modules/modules/modules_2_default/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>19.11.23</title> | ||
<script defer type="module" src="./main.js"></script> | ||
</head> | ||
<body> | ||
<h1>17.12.23</h1> | ||
<h2>Fetch</h2> | ||
|
||
<div id="buttons"> | ||
<button id="btnLoad">Start</button> | ||
</div> | ||
|
||
<hr/> | ||
|
||
<div id="output"> | ||
<table id='myTable'> | ||
|
||
</table> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { name as myName, default as myPrinter } from './array_utilities.js'; | ||
|
||
const myArr = ['Tomer', 'Gal', 'Moshe', 'Sahar']; | ||
myPrinter(myArr); | ||
alert(myName); | ||
|
||
// alert(`Name: ${name}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>19.11.23</title> | ||
<script defer type="module" src="./main.js"></script> | ||
</head> | ||
<body> | ||
<h1>20.12.23</h1> | ||
<h2>OOP</h2> | ||
|
||
<div id="buttons"> | ||
<button id="btnLoad">Start</button> | ||
</div> | ||
|
||
<hr/> | ||
|
||
<div id="output"> | ||
<table id='myTable'> | ||
|
||
</table> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
class Car { | ||
// Method/function that initializes (מאתחל) a new object (מופע חדש) | ||
constructor(make, model, year, color) { | ||
this.make = make; | ||
this.model = model; | ||
this.year = year; | ||
this.color = color; | ||
} | ||
|
||
printSummary() { | ||
console.log(` | ||
Make: ${this.make}\n | ||
Model: ${this.model}\n | ||
Year: ${this.year}\n | ||
Color: ${this.color}\n | ||
`); | ||
} | ||
} | ||
|
||
const tomersCar = new Car("Hyundai", "i20", 2016, "Gray"); | ||
const saharsCar = new Car("Seat", "Ibiza", 2012, "White"); | ||
|
||
alert(tomersCar.make); // --> Hyundai | ||
alert(saharsCar.make); // --> Seat | ||
|
||
tomersCar.printSummary(); | ||
saharsCar.printSummary(); |