Skip to content

Commit 298bc56

Browse files
authored
Merge pull request #548 from Dikendev/master
day 1 portuguese translation
2 parents c24de4c + 2bd214e commit 298bc56

31 files changed

+1338
-56
lines changed

Portuguese/02_Day_Data_types/02_day_data_types.md

Lines changed: 980 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<title>30DaysOfJavaScript</title>
6+
</head>
7+
8+
<body>
9+
<h1>30DaysOfJavaScript:02 Day</h1>
10+
<h2>Data types</h2>
11+
12+
<!-- import your scripts here -->
13+
<script src="./main.js"></script>
14+
15+
</body>
16+
17+
</html>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// this is your main.js script
75.4 KB
Loading
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const PI = Math.PI
2+
console.log(PI) // 3.141592653589793
3+
console.log(Math.round(PI)) // 3; to round values to the nearest number
4+
console.log(Math.round(9.81)) // 10
5+
console.log(Math.floor(PI)) // 3; rounding down
6+
console.log(Math.ceil(PI)) // 4; rounding up
7+
console.log(Math.min(-5, 3, 20, 4, 5, 10)) // -5, returns the minimum value
8+
console.log(Math.max(-5, 3, 20, 4, 5, 10)) // 20, returns the maximum value
9+
10+
const randNum = Math.random() // creates random number between 0 to 0.999999
11+
console.log(randNum)
12+
// Let create random number between 0 to 10
13+
const num = Math.floor(Math.random() * 11) // creates random number between 0 and 10
14+
console.log(num)
15+
16+
//Absolute value
17+
console.log(Math.abs(-10)) //10
18+
//Square root
19+
console.log(Math.sqrt(100)) // 10
20+
console.log(Math.sqrt(2)) //1.4142135623730951
21+
// Power
22+
console.log(Math.pow(3, 2)) // 9
23+
console.log(Math.E) // 2.718
24+
25+
// Logarithm
26+
//Returns the natural logarithm of base E of x, Math.log(x)
27+
console.log(Math.log(2)) // 0.6931471805599453
28+
console.log(Math.log(10)) // 2.302585092994046
29+
30+
// Trigonometry
31+
console.log(Math.sin(0))
32+
console.log(Math.sin(60))
33+
console.log(Math.cos(0))
34+
console.log(Math.cos(60))
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
let nums = [1, 2, 3]
2+
nums[0] = 10
3+
console.log(nums) // [10, 2, 3]
4+
5+
let nums = [1, 2, 3]
6+
let numbers = [1, 2, 3]
7+
console.log(nums == numbers) // false
8+
9+
let userOne = {
10+
name: 'Asabeneh',
11+
role: 'teaching',
12+
country: 'Finland'
13+
}
14+
let userTwo = {
15+
name: 'Asabeneh',
16+
role: 'teaching',
17+
country: 'Finland'
18+
}
19+
console.log(userOne == userTwo) // false
20+
21+
let numbers = nums
22+
console.log(nums == numbers) // true
23+
24+
let userOne = {
25+
name:'Asabeneh',
26+
role:'teaching',
27+
country:'Finland'
28+
}
29+
let userTwo = userOne
30+
console.log(userOne == userTwo) // true
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
let age = 35
2+
const gravity = 9.81 //we use const for non-changing values, gravitational constant in m/s2
3+
let mass = 72 // mass in Kilogram
4+
const PI = 3.14 // pi a geometrical constant
5+
6+
//More Examples
7+
const boilingPoint = 100 // temperature in oC, boiling point of water which is a constant
8+
const bodyTemp = 37 // oC average human body temperature, which is a constant
9+
console.log(age, gravity, mass, PI, boilingPoint, bodyTemp)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
let word = 'JavaScript'
2+
// we dont' modify string
3+
// we don't do like this, word[0] = 'Y'
4+
let numOne = 3
5+
let numTwo = 3
6+
console.log(numOne == numTwo) // true
7+
8+
let js = 'JavaScript'
9+
let py = 'Python'
10+
console.log(js == py) //false
11+
12+
let lightOn = true
13+
let lightOff = false
14+
console.log(lightOn == lightOff) // false
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Declaring different variables of different data types
2+
let space = ' '
3+
let firstName = 'Asabeneh'
4+
let lastName = 'Yetayeh'
5+
let country = 'Finland'
6+
let city = 'Helsinki'
7+
let language = 'JavaScript'
8+
let job = 'teacher'
9+
// Concatenating using addition operator
10+
let fullName = firstName + space + lastName // concatenation, merging two string together.
11+
console.log(fullName)
12+
13+
let personInfoOne = fullName + '. I am ' + age + '. I live in ' + country // ES5
14+
console.log(personInfoOne)
15+
// Concatenation: Template Literals(Template Strings)
16+
let personInfoTwo = `I am ${fullName}. I am ${age}. I live in ${country}.` //ES6 - String interpolation method
17+
let personInfoThree = `I am ${fullName}. I live in ${city}, ${country}. I am a ${job}. I teach ${language}.`
18+
console.log(personInfoTwo)
19+
console.log(personInfoThree)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
let space = ' ' // an empty space string
2+
let firstName = 'Asabeneh'
3+
let lastName = 'Yetayeh'
4+
let country = 'Finland'
5+
let city = 'Helsinki'
6+
let language = 'JavaScript'
7+
let job = 'teacher'

0 commit comments

Comments
 (0)