Skip to content

Commit 918c193

Browse files
committed
translate "Constructors of Built-In Types" in "Types" to ja
1 parent 5dca698 commit 918c193

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

‎doc/ja/types/casting.md‎

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,19 @@ JavaScriptは*弱い型付け*の言語なので、可能な**限り**に*型強
2121
2222
上記の自体を避ける為に、[strict equal operator](#types.equality)を使用する事を**強く**推奨します。また、これはたくさんある落し穴を避けますが、それでもまだJavaScriptの弱い型付けシステムから発生する色々な課題が残っています。
2323

24-
### Constructors of Built-In Types
24+
### 組み込み型のコンストラクタ
2525

26-
The constructors of the built in types like `Number` and `String` behave
27-
differently when being used with the `new` keyword and without it.
26+
`Number`や`String`のような組み込み型のコンストラクタは、`new`キーワードの有無で振る舞いが違ってきます。
2827

29-
new Number(10) === 10; // False, Object and Number
30-
Number(10) === 10; // True, Number and Number
31-
new Number(10) + 0 === 10; // True, due to implicit conversion
28+
new Number(10) === 10; // False, ObjectとNumber
29+
Number(10) === 10; // True, NumberとNumber
30+
new Number(10) + 0 === 10; // True, 暗黙の型変換によります
3231

33-
Using a built-in type like `Number` as a constructor will create a new `Number`
34-
object, but leaving out the `new` keyword will make the `Number` function behave
35-
like a converter.
32+
`Number`のような組み込み型をコンストラクタとして使うと、新しい`Number`オブジェクトが作られますが、`new`キーワードを除外すると`Number`関数がコンバーターのように振る舞います。
3633

37-
In addition, having literals or non-object values in there will result in even
38-
more type coercion.
34+
加えて、リテラルかオブジェトではない値を持っていると、さらに型強制が多くなります。
3935

40-
The best option is to cast to one of the three possible types **explicitly**.
36+
最良のオプションは以下の3つの方法の内、1つで型を**明示**する事になります。
4137

4238
### Casting to a String
4339

0 commit comments

Comments
 (0)