Skip to content

Commit 9195ba5

Browse files
authored
Add files via upload
1 parent ce41a2a commit 9195ba5

File tree

3 files changed

+82
-8
lines changed

3 files changed

+82
-8
lines changed

02_numbers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
// 1 Number
23
// const num = 42 // integer
34
// const float = 42.42 // float\
@@ -66,5 +67,4 @@
6667
// return Math.floor(Math.random() * (max - min + 1) + min)
6768
// }
6869

69-
// console.log(getRandomBetween(10, 42))
70-
70+
// console.log(getRandomBetween(10, 42))

03_strings.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// const name = 'Серёга'
2+
// const age = 20
3+
4+
// function getAge() {
5+
// return age
6+
// }
7+
8+
// const output = 'Привет, меня зовут ' + name + ' и мне ' + age + ' лет.'
9+
// const output = `Привет, меня зовут ${name} и мне ${age < 30 ? 'A' : 'B'} лет.`
10+
// console.log(output)
11+
12+
// const output = `
13+
// <div>This is div</div>
14+
// <p>this is p</p>
15+
// `
16+
17+
// console.log(output)
18+
19+
// const nameA = 'Сергей'
20+
// console.log(nameA.length)
21+
// console.log(nameA.toUpperCase())
22+
// console.log(nameA.toLowerCase())
23+
// console.log(nameA.charAt(2))
24+
// console.log(nameA.indexOf('!'))
25+
// console.log(nameA.toLowerCase().startsWith('серг'))
26+
// console.log(nameA.endsWith('й'))
27+
// console.log(nameA.repeat(3))
28+
// const string = ' password '
29+
// console.log(string.trim())
30+
// console.log(string.trimLeft())
31+
// console.log(string.trimRight())
32+
33+
// function logPerson(s, name, age) {
34+
// if (age < 0) {
35+
// age = 'Ещё не родился'
36+
// }
37+
// return `${s[0]}${name}${s[1]}${age}${s[2]}`
38+
// }
39+
40+
// const personName = 'Sergey'
41+
// const personName2 = 'Max'
42+
// const personAge = 20
43+
// const personAge2 = -10
44+
45+
// const output = logPerson`Имя: ${personName}, Возраст: ${personAge}!`
46+
// const output2 = logPerson`Имя: ${personName2}, Возраст: ${personAge2}!`
47+
// console.log(output)
48+
// console.log(output2)
49+

app.js

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
1-
const name = 'Серёга'
2-
const age = 20
3-
4-
// const output = 'Привет, меня зовут ' + name + ' и мне ' + age + ' лет.'
5-
const output =
6-
console.log(output)
1+
// 1 Функции
2+
// Function Declaration
3+
// function greet(name) {
4+
// console.log('Привет, ', name)
5+
// }
6+
7+
// Function Expression
8+
// const greet2 = function greet2(name) {
9+
// console.log('Привет 2, ', name)
10+
// }
11+
12+
13+
14+
15+
// greet('Васек')
16+
// greet2('Серега')
17+
// console.log(typeof greet)
18+
// console.dir(greet)
19+
20+
// 2 Анонимные функции
21+
// let counter = 0
22+
// const interval = setInterval(function() {
23+
// if (counter === 5) {
24+
// clearInterval(interval) //clearTimeout
25+
// } else {
26+
// console.log(++counter)
27+
// }
28+
// }, 1000)
29+
30+
// 3 Стрелочные функции
31+

0 commit comments

Comments
 (0)