Skip to content
This repository was archived by the owner on Aug 5, 2021. It is now read-only.

Js/core 3/week1/nihal #52

Open
wants to merge 4 commits into
base: master
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ After you've watched these videos I'd like you to answer these questions

## 1. What do you think the most important quality for a programmer is?

<!-- Write your answer here -->
In my opinion, the most important quality for a programmer is good time and task manegement. At the same time the programmer should have quick learning ability.


## 2. When trying to solve a challenge, what should you do first?

<!-- Write your answer here -->
I should start with braking the task and then try to solve the problem step by step.

## 3. What should you do if you get stuck?

<!-- Write your answer here -->
If I got stuck I can go for a walk an calm my self and stop thinking about the problem.
12 changes: 6 additions & 6 deletions week-1/Homework/mandatory/1-debugging-practice/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ function submit() {
alert("Please fill all fields!");
return false;
} else {
let book = new Book(title.value, title.value, pages.value, check.checked);
library.push(book);
let book = new Book(title.value, author.value, pages.value, check.checked);
myLibrary.push(book);
render();
}
}
Expand All @@ -54,7 +54,7 @@ function render() {
let table = document.getElementById("display");
let rowsNumber = table.rows.length;
//delete old table
for (let n = rowsNumber - 1; n > 0; n-- {
for (let n = rowsNumber - 1; n > 0; n--) {
table.deleteRow(n);
}
//insert updated row and cells
Expand All @@ -76,7 +76,7 @@ function render() {
changeBut.className = "btn btn-success";
cell4.appendChild(changeBut);
let readStatus = "";
if (myLibrary[i].check == false) {
if (myLibrary[i].check == true) {
readStatus = "Yes";
} else {
readStatus = "No";
Expand All @@ -89,12 +89,12 @@ function render() {
});

//add delete button to every row and render again
let delButton = document.createElement("button");
let delBut = document.createElement("button");
delBut.id = i + 5;
cell5.appendChild(delBut);
delBut.className = "btn btn-warning";
delBut.innerHTML = "Delete";
delBut.addEventListener("clicks", function () {
delBut.addEventListener("click", function () {
alert(`You've deleted title: ${myLibrary[i].title}`);
myLibrary.splice(i, 1);
render();
Expand Down
5 changes: 4 additions & 1 deletion week-2/Homework/mandatory/2-fetch-exercise/exercise.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ Open index.html in your browser. Every time you refresh the page,
a different greeting should be displayed in the box.
*/

fetch('*** Write the API address here ***')
fetch('https://codeyourfuture.herokuapp.com/api/greetings')
.then(function(response) {
return response.text();
})
.then(function(greeting) {
let greetingText = document.getElementById("greeting-text")
greetingText.textContent = greeting;
console.log(greetingText)
// Write the code to display the greeting text here
});
19 changes: 19 additions & 0 deletions week-2/Homework/mandatory/3-dog-photo-gallery/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
</head>
<body>
<button id="newBtn">Photo</button>
<ul id="dogPhoto">

</ul>

<script src="" async defer></script>
</body>
</html>
Empty file.
8 changes: 8 additions & 0 deletions week-2/Homework/mandatory/3-dog-photo-gallery/style.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
fetch(`https://dog.ceo/api/breeds/image/random`)
.then(function(response) {
return response.json;
})

.then(function(data){

})
21 changes: 21 additions & 0 deletions week-2/Homework/mandatory/4-programmer-humour/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
</head>
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="#">upgrade your browser</a> to improve your experience.</p>
<![endif]-->

<script src="" async defer></script>
</body>
</html>
Empty file.
12 changes: 12 additions & 0 deletions week-2/Homework/mandatory/4-programmer-humour/style.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
fetch(`https://xkcd.now.sh/?comic=latest`)

.then(function(response) {
return response.json;
})

.then(function(data) {

})
.catch(function(error) {
console.log(error)
});