0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

P5.js 日本語リファレンス(concat)

Last updated at Posted at 2020-05-24

このページでは[「P5.js 日本語リファレンス」] (https://qiita.com/bit0101/items/91818244dc26c767a0fe) の concat関数を説明します。

concat()

説明文

注意: 非推奨

concat() は非推奨であり、p5の将来のバージョンで削除される予定です。代わりにarr1.concat(arr2)を使用してください。

引数で指定した2つの配列を連結します。引数で指定した2つの配列は変更しません。

構文

concat(a, b)

パラメタ

  • a
    Array:連結する最初の配列

  • b
    Array:連結する2番目の配列

戻り値

Array:連結配列

例1

function setup() {
  let arr1 = ['A',  'B',  'C​​'];
  let arr2 = [1, 2, 3];

  print(arr1); // ['A',  'B',  'C​​']
  print(arr2); // [1,2,3]

  let arr3 = concat(arr1, arr2);

  print(arr1); // ['A',  'B',  'C​​']
  print(arr2); // [1, 2, 3]
  print(arr3); // ['A',  'B',  'C​​', 1, 2, 3]
}

著作権

p5.js was created by Lauren McCarthy and is developed by a community of collaborators, with support from the Processing Foundation and NYU ITP. Identity and graphic design by Jerel Johnson.

ライセンス

Creative Commons(CC BY-NC-SA 4.0) に従います。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?