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
1 change: 0 additions & 1 deletion README.md

This file was deleted.

22 changes: 22 additions & 0 deletions task02.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script>
'use strict'
for(let i=0; i <= 10; i++){
if(i == 0){
console.log(i + ' - это ноль')
} else if(i % 2 == 0){
console.log(i + ' - четное число')
} else{
console.log(i + ' - нечетное число')
}

}
</script>
</body>
</html>
44 changes: 44 additions & 0 deletions task03.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Document</title>
</head>

<body>
<script>
'use strict'
const post = {
author: "John", //вывести этот текст
postId: 23,
comments: [
{
userId: 10,
userName: "Alex",
text: "lorem ipsum",
rating: {
likes: 10,
dislikes: 2 //вывести это число
}
},
{
userId: 5, //вывести это число
userName: "Jane",
text: "lorem ipsum 2", //вывести этот текст
rating: {
likes: 3,
dislikes: 1
}
},
]
}

console.log(post.author)
console.log(post.comments[0].rating.dislikes)
console.log(post.comments[1].userId)
console.log(post.comments[1].text)
</script>
</body>

</html>
31 changes: 31 additions & 0 deletions task04.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Document</title>
</head>

<body>
<script>
'use strict'
const products = [
{
id: 3,
price: 200,
},
{
id: 4,
price: 900,
},
{
id: 1,
price: 1000,
},
];

products.forEach(function(item){console.log(item.price*0.85)})
</script>
</body>

</html>
41 changes: 41 additions & 0 deletions task05.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script>
'use strict'
const products = [
{
id: 3,
price: 127,
photos: [
"1.jpg",
"2.jpg",
]
},
{
id: 5,
price: 499,
photos: []
},
{
id: 10,
price: 26,
photos: [
"3.jpg"
]
},
{
id: 8,
price: 78,
},
];

let filtered = products.filter(function(item){return item.photos !== undefined && item.photos.length != 0})
console.log(filtered)
</script>
</body>
</html>
13 changes: 13 additions & 0 deletions task06.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">
<title>Document</title>
</head>
<body>
<script>
'use strict'
for(let i = 0; i <= 9;console.log(i++)){}
</script>
</body>
</html>
19 changes: 19 additions & 0 deletions task07.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script>
'use strict'
for(let i =1; i <= 20; i++){
let res_str = ''
for(let j = 0; j < i; j++){
res_str += 'x'
}
console.log(res_str)
}
</script>
</body>
</html>