Skip to content

Commit ce41a2a

Browse files
authored
Add files via upload
1 parent a8c1a25 commit ce41a2a

File tree

2 files changed

+76
-20
lines changed

2 files changed

+76
-20
lines changed

02_numbers.js

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// 1 Number
2+
// const num = 42 // integer
3+
// const float = 42.42 // float\
4+
// const pow = 10e3
5+
6+
// console.log('MAX_SAFE_INTEGER ', Number.MAX_SAFE_INTEGER)
7+
// console.log('Math.pow 53', Math.pow(2, 53,) - 1)
8+
// console.log('MIN_SAFE_INTEGER ', Number.MIN_SAFE_INTEGER)
9+
// console.log('MAX VALUE', Number.MAX_VALUE)
10+
// console.log('MIN VALUE', Number.MIN_VALUE)
11+
// console.log('POSITIVE_INFINITY', Number.POSITIVE_INFINITY)
12+
// console.log('NEGATIVE_INFINITY', Number.NEGATIVE_INFINITY)
13+
// console.log('2 / 0', 2 / 0)
14+
// console.log(Number.NaN) // Not A Number
15+
// console.log(typeof NaN)
16+
// const weird = 2 / undefined
17+
// console.log(2 / undefined)
18+
// console.log(Number.isNaN(weird))
19+
// console.log(Number.isNaN(42))
20+
// console.log(Number.isFinite(Infinity))
21+
// console.log(Number.isFinite(42))
22+
23+
// const stringInt = '40'
24+
// const stringFloat = '40.42'
25+
// console.log(Number.parseInt(stringInt) + 2)
26+
// console.log(Number(stringInt) + 2)
27+
// console.log(+stringInt + 2)
28+
29+
// console.log('Now floats!')
30+
31+
// console.log(parseFloat(stringFloat) + 2)
32+
// console.log(+stringFloat + 2)
33+
34+
// console.log(0.4 + 0.2) // 0.6
35+
// console.log((2 / 5) + (1 / 5))
36+
// console.log(parseFloat((0.4 + 0.2).toFixed(1)))
37+
38+
// 2 BigInt
39+
// console.log(90071992547409919999999n - 90071992547400099999n)
40+
// console.log(-90071992547409919999999n)
41+
// console.log(90071992547409919999999.232323n) // error bcs that is not Int
42+
43+
// console.log(10n - 4) // error
44+
// console.log(parseInt(10n) - 4)
45+
// console.log(10n - BigInt(4))
46+
// console.log(5n/2n)
47+
48+
// 3 Math
49+
// console.log(Math.E)
50+
// console.log(Math.PI)
51+
52+
// console.log(Math.pow(5, 3))
53+
// console.log(Math.abs(-42))
54+
// console.log(Math.min(42, 12, 23, 11, 422))
55+
// console.log(Math.max(42, 12, 23, 11, 422))
56+
// console.log(Math.floor(4.9))
57+
// console.log(Math.ceil(5.1))
58+
// console.log(Math.round(4.9))
59+
// console.log(Math.trunc(4.9))
60+
61+
// console.log(Math.random())
62+
63+
// 4 Example
64+
65+
// function getRandomBetween(min, max) {
66+
// return Math.floor(Math.random() * (max - min + 1) + min)
67+
// }
68+
69+
// console.log(getRandomBetween(10, 42))
70+

app.js

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
1-
// Number
2-
const num = 42 // integer
3-
const float = 42.42 // float\
4-
const pow = 10e3
5-
6-
console.log('MAX_SAFE_INTEGER ', Number.MAX_SAFE_INTEGER)
7-
console.log('Math.pow 53', Math.pow(2, 53,) - 1)
8-
console.log('MIN_SAFE_INTEGER ', Number.MIN_SAFE_INTEGER)
9-
console.log('MAX VALUE', Number.MAX_VALUE)
10-
console.log('MIN VALUE', Number.MIN_VALUE)
11-
console.log('POSITIVE_INFINITY', Number.POSITIVE_INFINITY)
12-
console.log('NEGATIVE_INFINITY', Number.NEGATIVE_INFINITY)
13-
console.log('2 / 0', 2 / 0)
14-
console.log(Number.NaN) // Not A Number
15-
console.log(typeof NaN)
16-
const weird = 2 / undefined
17-
console.log(2 / undefined)
18-
console.log(Number.isNaN(weird))
19-
console.log(Number.isNaN(42))
20-
console.log('Yeaaaah buddy!')
1+
const name = 'Серёга'
2+
const age = 20
3+
4+
// const output = 'Привет, меня зовут ' + name + ' и мне ' + age + ' лет.'
5+
const output =
6+
console.log(output)

0 commit comments

Comments
 (0)