ケース I:
var xTest = "Hello world"; //String variable.
xTest += 10; //Integer widens to String.
alert(xTest);
結果:Hello world10
ケース II:
var xTest = 10; //Integer variable.
xTest += "Hello World"; //String widens to integer.
alert(xTest);
結果 : 10Hello world
ケース I とケース II のパフォーマンスは同じです。Integer
に広がりstring
、許容範囲です。しかし、どのようにString
拡大しinteger
、どのように . を返すことができstring
ますか? をスローする必要がありましたInvalidCastException
。私は正しいですか?Type
いつでもa のを変換できvariable
ますか? [たとえば、計算を行うためにvariable
内部で 'x'を使用script
しています (例: x = 10 * 5)。後で、5 行の後に.?code
に同じものを使用できることを意味します] 現時点では少し混乱しています。 .integer variable
String manipulations
JS
[ からの移行VB.Net
]を学んでいます