メソッド Type method
抽出要素 = 配列オブジェクト.splice(位置, 長さ, 置換文字列) Extract elements form = array object. Splice (position, length, string replacement)
Commentary
spliceは配列要素を指定された位置または範囲で分割します。 splice the split location for the specified range or an array element. 返りは指定された範囲の要素になり、元の配列は残りの要素になります。 The return value is the element of the range specified in the original sequence and the remaining element. 置換文字列が指定されている場合、元の配列に指定された位置または範囲の後に置換文字列が挿入されます。
If the replacement string is specified, the replacement string is
inserted after the position or range specified in the original sequence. 置換文字列はカンマで区切って列記することができます。 Replacement string can be listed separated by commas.
サンプルコード Sample code
a = new Array(12,34,"AB","CD","EF"); a = new Array (12,34, "AB", "CD", "EF");
b = a.splice(1,2,"ZZ"); b = a.splice (1,2, "ZZ");
outputs[0] = a.toString()+String.fromCharCode(10)+b.toString(); outputs [0] = a.toString () + String.fromCharCode (10) + b.toString ();