Skip to content

Commit d022c76

Browse files
committed
resolving conflict
1 parent 24c79bd commit d022c76

File tree

1 file changed

+1
-10
lines changed
  • 1-js/02-first-steps/06-type-conversions/1-primitive-conversions-questions

1 file changed

+1
-10
lines changed

1-js/02-first-steps/06-type-conversions/1-primitive-conversions-questions/solution.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,10 @@ undefined + 1 = NaN // (6)
1717
" \t \n" - 2 = -2 // (7)
1818
```
1919

20-
<<<<<<< HEAD
2120
1. Penambahan dengan string `"" + 1` mengkonversi `1` ke string: `"" + 1 = "1"`, dan kita punya `"1" + 0`, aturan yang sama berlaku.
2221
2. Pengurangan `-` (seperti kebanyakan operasi matematika) cuma berjalan dengan angka, ia mengkonversi string kosong `""` ke `0`.
2322
3. Penambahan dengan string mengappend angka `5` ke string.
2423
4. Pengurangan selalu mengkonversi ke angka, jadi ia membuat `" -9 "` menjadi angka `-9` (mengabaikan spasi sekitarnya).
2524
5. `null` menjadi `0` setelah konversi numerik.
2625
6. `undefined` menjadi `NaN` setelah konversi numerik.
27-
=======
28-
1. The addition with a string `"" + 1` converts `1` to a string: `"" + 1 = "1"`, and then we have `"1" + 0`, the same rule is applied.
29-
2. The subtraction `-` (like most math operations) only works with numbers, it converts an empty string `""` to `0`.
30-
3. The addition with a string appends the number `5` to the string.
31-
4. The subtraction always converts to numbers, so it makes `" -9 "` a number `-9` (ignoring spaces around it).
32-
5. `null` becomes `0` after the numeric conversion.
33-
6. `undefined` becomes `NaN` after the numeric conversion.
34-
7. Space characters, are trimmed off string start and end when a string is converted to a number. Here the whole string consists of space characters, such as `\t`, `\n` and a "regular" space between them. So, similarly to an empty string, it becomes `0`.
35-
>>>>>>> a0bfa924a17cad8e7fee213904b27dbf57c2dbac
26+
7. Karakter spasi, ialah string yang depan dan belakangnya ditrim ketika string dikonversi ke angka. Berikut seluruh string berisi karakter spasi, seperti `\t`, `\n` dan spasi "reguler" di antaranya. Jadi, serupa dengan string kosong, ia menjadi `0`.

0 commit comments

Comments
 (0)