Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Indonesia Language Translation #889

Open
wants to merge 5 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
980 changes: 980 additions & 0 deletions Indonesia/02_Day_Data_types/02_day_data_types.md

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions Indonesia/02_Day_Data_types/02_day_starter/index.html
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">

<head>
<title>30DaysOfJavaScript</title>
</head>

<body>
<h1>30DaysOfJavaScript:02 Day</h1>
<h2>Data types</h2>

<!-- import your scripts here -->
<script src="./main.js"></script>

</body>

</html>
1 change: 1 addition & 0 deletions Indonesia/02_Day_Data_types/02_day_starter/main.js
@@ -0,0 +1 @@
// this is your main.js script
Binary file added Indonesia/02_Day_Data_types/day_1_2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Indonesia/02_Day_Data_types/math_object.js
@@ -0,0 +1,34 @@
const PI = Math.PI
console.log(PI) // 3.141592653589793
console.log(Math.round(PI)) // 3; to round values to the nearest number
console.log(Math.round(9.81)) // 10
console.log(Math.floor(PI)) // 3; rounding down
console.log(Math.ceil(PI)) // 4; rounding up
console.log(Math.min(-5, 3, 20, 4, 5, 10)) // -5, returns the minimum value
console.log(Math.max(-5, 3, 20, 4, 5, 10)) // 20, returns the maximum value

const randNum = Math.random() // creates random number between 0 to 0.999999
console.log(randNum)
// Let create random number between 0 to 10
const num = Math.floor(Math.random() * 11) // creates random number between 0 and 10
console.log(num)

//Absolute value
console.log(Math.abs(-10)) //10
//Square root
console.log(Math.sqrt(100)) // 10
console.log(Math.sqrt(2)) //1.4142135623730951
// Power
console.log(Math.pow(3, 2)) // 9
console.log(Math.E) // 2.718

// Logarithm
//Returns the natural logarithm of base E of x, Math.log(x)
console.log(Math.log(2)) // 0.6931471805599453
console.log(Math.log(10)) // 2.302585092994046

// Trigonometry
console.log(Math.sin(0))
console.log(Math.sin(60))
console.log(Math.cos(0))
console.log(Math.cos(60))
30 changes: 30 additions & 0 deletions Indonesia/02_Day_Data_types/non_primitive_data_types.js
@@ -0,0 +1,30 @@
let nums = [1, 2, 3]
nums[0] = 10
console.log(nums) // [10, 2, 3]

let nums = [1, 2, 3]
let numbers = [1, 2, 3]
console.log(nums == numbers) // false

let userOne = {
name: 'Asabeneh',
role: 'teaching',
country: 'Finland'
}
let userTwo = {
name: 'Asabeneh',
role: 'teaching',
country: 'Finland'
}
console.log(userOne == userTwo) // false

let numbers = nums
console.log(nums == numbers) // true

let userOne = {
name:'Asabeneh',
role:'teaching',
country:'Finland'
}
let userTwo = userOne
console.log(userOne == userTwo) // true
9 changes: 9 additions & 0 deletions Indonesia/02_Day_Data_types/number_data_types.js
@@ -0,0 +1,9 @@
let age = 35
const gravity = 9.81 //we use const for non-changing values, gravitational constant in m/s2
let mass = 72 // mass in Kilogram
const PI = 3.14 // pi a geometrical constant

//More Examples
const boilingPoint = 100 // temperature in oC, boiling point of water which is a constant
const bodyTemp = 37 // oC average human body temperature, which is a constant
console.log(age, gravity, mass, PI, boilingPoint, bodyTemp)
14 changes: 14 additions & 0 deletions Indonesia/02_Day_Data_types/primitive_data_types.js
@@ -0,0 +1,14 @@
let word = 'JavaScript'
// we dont' modify string
// we don't do like this, word[0] = 'Y'
let numOne = 3
let numTwo = 3
console.log(numOne == numTwo) // true

let js = 'JavaScript'
let py = 'Python'
console.log(js == py) //false

let lightOn = true
let lightOff = false
console.log(lightOn == lightOff) // false
19 changes: 19 additions & 0 deletions Indonesia/02_Day_Data_types/string_concatenation.js
@@ -0,0 +1,19 @@
// Declaring different variables of different data types
let space = ' '
let firstName = 'Asabeneh'
let lastName = 'Yetayeh'
let country = 'Finland'
let city = 'Helsinki'
let language = 'JavaScript'
let job = 'teacher'
// Concatenating using addition operator
let fullName = firstName + space + lastName // concatenation, merging two string together.
console.log(fullName)

let personInfoOne = fullName + '. I am ' + age + '. I live in ' + country // ES5
console.log(personInfoOne)
// Concatenation: Template Literals(Template Strings)
let personInfoTwo = `I am ${fullName}. I am ${age}. I live in ${country}.` //ES6 - String interpolation method
let personInfoThree = `I am ${fullName}. I live in ${city}, ${country}. I am a ${job}. I teach ${language}.`
console.log(personInfoTwo)
console.log(personInfoThree)
7 changes: 7 additions & 0 deletions Indonesia/02_Day_Data_types/string_data_types.js
@@ -0,0 +1,7 @@
let space = ' ' // an empty space string
let firstName = 'Asabeneh'
let lastName = 'Yetayeh'
let country = 'Finland'
let city = 'Helsinki'
let language = 'JavaScript'
let job = 'teacher'
12 changes: 12 additions & 0 deletions Indonesia/02_Day_Data_types/string_methods/accessing_character.js
@@ -0,0 +1,12 @@
// Let us access the first character in 'JavaScript' string.

let string = 'JavaScript'
let firstLetter = string[0]
console.log(firstLetter) // J
let secondLetter = string[1] // a
let thirdLetter = string[2]
let lastLetter = string[9]
console.log(lastLetter) // t
let lastIndex = string.length - 1
console.log(lastIndex) // 9
console.log(string[lastIndex]) // t
6 changes: 6 additions & 0 deletions Indonesia/02_Day_Data_types/string_methods/char_at.js
@@ -0,0 +1,6 @@
// charAt(): Takes index and it returns the value at that index
string.charAt(index)
let string = '30 Days Of JavaScript'
console.log(string.charAt(0)) // 3
let lastIndex = string.length - 1
console.log(string.charAt(lastIndex)) // t
7 changes: 7 additions & 0 deletions Indonesia/02_Day_Data_types/string_methods/char_code_at.js
@@ -0,0 +1,7 @@
// charCodeAt(): Takes index and it returns char code(ASCII number) of the value at that index

string.charCodeAt(index)
let string = '30 Days Of JavaScript'
console.log(string.charCodeAt(3)) // D ASCII number is 51
let lastIndex = string.length - 1
console.log(string.charCodeAt(lastIndex)) // t ASCII is 116
6 changes: 6 additions & 0 deletions Indonesia/02_Day_Data_types/string_methods/concat.js
@@ -0,0 +1,6 @@
// concat(): it takes many substrings and creates concatenation.
// string.concat(substring, substring, substring)
let string = '30'
console.log(string.concat("Days", "Of", "JavaScript")) // 30DaysOfJavaScript
let country = 'Fin'
console.log(country.concat("land")) // Finland
11 changes: 11 additions & 0 deletions Indonesia/02_Day_Data_types/string_methods/ends_with.js
@@ -0,0 +1,11 @@
// endsWith: it takes a substring as an argument and it checks if the string starts with that specified substring. It returns a boolean(true or false).
// string.endsWith(substring)
let string = 'Love is the best to in this world'
console.log(string.endsWith('world')) // true
console.log(string.endsWith('love')) // false
console.log(string.endsWith('in this world')) // true

let country = 'Finland'
console.log(country.endsWith('land')) // true
console.log(country.endsWith('fin')) // false
console.log(country.endsWith('Fin')) // false
14 changes: 14 additions & 0 deletions Indonesia/02_Day_Data_types/string_methods/includes.js
@@ -0,0 +1,14 @@
// includes(): It takes a substring argument and it check if substring argument exists in the string. includes() returns a boolean. It checks if a substring exist in a string and it returns true if it exists and false if it doesn't exist.
let string = '30 Days Of JavaScript'
console.log(string.includes('Days')) // true
console.log(string.includes('days')) // false
console.log(string.includes('Script')) // true
console.log(string.includes('script')) // false
console.log(string.includes('java')) // false
console.log(string.includes('Java')) // true

let country = 'Finland'
console.log(country.includes('fin')) // false
console.log(country.includes('Fin')) // true
console.log(country.includes('land')) // true
console.log(country.includes('Land')) // false
11 changes: 11 additions & 0 deletions Indonesia/02_Day_Data_types/string_methods/index_of.js
@@ -0,0 +1,11 @@
// indexOf(): Takes takes a substring and if the substring exists in a string it returns the first position of the substring if does not exist it returns -1

string.indexOf(substring)
let string = '30 Days Of JavaScript'
console.log(string.indexOf('D')) // 3
console.log(string.indexOf('Days')) // 3
console.log(string.indexOf('days')) // -1
console.log(string.indexOf('a')) // 4
console.log(string.indexOf('JavaScript')) // 11
console.log(string.indexOf('Script')) //15
console.log(string.indexOf('script')) // -1
6 changes: 6 additions & 0 deletions Indonesia/02_Day_Data_types/string_methods/last_index_of.js
@@ -0,0 +1,6 @@
// lastIndexOf(): Takes takes a substring and if the substring exists in a string it returns the last position of the substring if it does not exist it returns -1

let string = 'I love JavaScript. If you do not love JavaScript what else can you love.'
console.log(string.lastIndexOf('love')) // 67
console.log(string.lastIndexOf('you')) // 63
console.log(string.lastIndexOf('JavaScript')) // 38
6 changes: 6 additions & 0 deletions Indonesia/02_Day_Data_types/string_methods/length.js
@@ -0,0 +1,6 @@
// length: The string length method returns the number of characters in a string included empty space. Example:

let js = 'JavaScript'
console.log(js.length) // 10
let firstName = 'Asabeneh'
console.log(firstName.length) // 8
22 changes: 22 additions & 0 deletions Indonesia/02_Day_Data_types/string_methods/match.js
@@ -0,0 +1,22 @@
// match: it takes a substring or regular expression pattern as an argument and it returns an array if there is match if not it returns null. Let us see how a regular expression pattern looks like. It starts with / sign and ends with / sign.
let string = 'love'
let patternOne = /love/ // with out any flag
let patternTwo = /love/gi // g-means to search in the whole text, i - case insensitive
string.match(substring)
let string = 'I love JavaScript. If you do not love JavaScript what else can you love.'
console.log(string.match('love')) //
/*
output

["love", index: 2, input: "I love JavaScript. If you do not love JavaScript what else can you love.", groups: undefined]
*/
let pattern = /love/gi
console.log(string.match(pattern)) // ["love", "love", "love"]
// Let us extract numbers from text using regular expression. This is not regular expression section, no panic.

let txt = 'In 2019, I run 30 Days of Python. Now, in 2020 I super exited to start this challenge'
let regEx = /\d/g // d with escape character means d not a normal d instead acts a digit
// + means one or more digit numbers,
// if there is g after that it means global, search everywhere.
console.log(txt.match(regEx)) // ["2", "0", "1", "9", "3", "0", "2", "0", "2", "0"]
console.log(txt.match(/\d+/g)) // ["2019", "30", "2020"]
4 changes: 4 additions & 0 deletions Indonesia/02_Day_Data_types/string_methods/repeat.js
@@ -0,0 +1,4 @@
// repeat(): it takes a number argument and it returned the repeated version of the string.
// string.repeat(n)
let string = 'love'
console.log(string.repeat(10)) // lovelovelovelovelovelovelovelovelovelove
7 changes: 7 additions & 0 deletions Indonesia/02_Day_Data_types/string_methods/replace.js
@@ -0,0 +1,7 @@
// replace(): takes to parameter the old substring and new substring.
// string.replace(oldsubstring, newsubstring)

let string = '30 Days Of JavaScript'
console.log(string.replace('JavaScript', 'Python')) // 30 Days Of Python
let country = 'Finland'
console.log(country.replace('Fin', 'Noman')) // Nomanland
4 changes: 4 additions & 0 deletions Indonesia/02_Day_Data_types/string_methods/search.js
@@ -0,0 +1,4 @@
// search: it takes a substring as an argument and it returns the index of the first match.
// string.search(substring)
let string = 'I love JavaScript. If you do not love JavaScript what else can you love.'
console.log(string.search('love')) // 2
10 changes: 10 additions & 0 deletions Indonesia/02_Day_Data_types/string_methods/split.js
@@ -0,0 +1,10 @@
// split(): The split method splits a string at a specified place.
let string = '30 Days Of JavaScript'
console.log(string.split()) // ["30 Days Of JavaScript"]
console.log(string.split(' ')) // ["30", "Days", "Of", "JavaScript"]
let firstName = 'Asabeneh'
console.log(firstName.split()) // ["Asabeneh"]
console.log(firstName.split('')) // ["A", "s", "a", "b", "e", "n", "e", "h"]
let countries = 'Finland, Sweden, Norway, Denmark, and Iceland'
console.log(countries.split(',')) // ["Finland", " Sweden", " Norway", " Denmark", " and Iceland"]
console.log(countries.split(', ')) // ["Finland", "Sweden", "Norway", "Denmark", "and Iceland"]
11 changes: 11 additions & 0 deletions Indonesia/02_Day_Data_types/string_methods/starts_with.js
@@ -0,0 +1,11 @@
// startsWith: it takes a substring as an argument and it checks if the string starts with that specified substring. It returns a boolean(true or false).
// string.startsWith(substring)
let string = 'Love is the best to in this world'
console.log(string.startsWith('Love')) // true
console.log(string.startsWith('love')) // false
console.log(string.startsWith('world')) // false

let country = 'Finland'
console.log(country.startsWith('Fin')) // true
console.log(country.startsWith('fin')) // false
console.log(country.startsWith('land')) // false
5 changes: 5 additions & 0 deletions Indonesia/02_Day_Data_types/string_methods/substr.js
@@ -0,0 +1,5 @@
//substr(): It takes two arguments,the starting index and number of characters to slice.
let string = 'JavaScript'
console.log(string.substr(4,6)) // Script
let country = 'Finland'
console.log(country.substr(3, 4)) // land
9 changes: 9 additions & 0 deletions Indonesia/02_Day_Data_types/string_methods/substring.js
@@ -0,0 +1,9 @@
// substring(): It takes two arguments,the starting index and the stopping index but it doesn't include the stopping index.
let string = 'JavaScript'
console.log(string.substring(0,4)) // Java
console.log(string.substring(4,10)) // Script
console.log(string.substring(4)) // Script
let country = 'Finland'
console.log(country.substring(0, 3)) // Fin
console.log(country.substring(3, 7)) // land
console.log(country.substring(3)) // land
7 changes: 7 additions & 0 deletions Indonesia/02_Day_Data_types/string_methods/to_lowercase.js
@@ -0,0 +1,7 @@
// toLowerCase(): this method changes the string to lowercase letters.
let string = 'JavasCript'
console.log(string.toLowerCase()) // javascript
let firstName = 'Asabeneh'
console.log(firstName.toLowerCase()) // asabeneh
let country = 'Finland'
console.log(country.toLowerCase()) // finland
8 changes: 8 additions & 0 deletions Indonesia/02_Day_Data_types/string_methods/to_uppercase.js
@@ -0,0 +1,8 @@
// toUpperCase(): this method changes the string to uppercase letters.

let string = 'JavaScript'
console.log(string.toUpperCase()) // JAVASCRIPT
let firstName = 'Asabeneh'
console.log(firstName.toUpperCase()) // ASABENEH
let country = 'Finland'
console.log(country.toUpperCase()) // FINLAND
7 changes: 7 additions & 0 deletions Indonesia/02_Day_Data_types/string_methods/trim.js
@@ -0,0 +1,7 @@
//trim(): Removes trailing space in the beginning or the end of a string.
let string = ' 30 Days Of JavaScript '
console.log(string) //
console.log(string.trim(' ')) //
let firstName = ' Asabeneh '
console.log(firstName)
console.log(firstName.trim()) //