0
0

More than 3 years have passed since last update.

配列の扱い方

Posted at

目次

①配列とは
②配列の扱い方

①配列とは

データの集合体のこと。一つの変数に対して複数の値を格納できる。

②配列の扱い方

//下記のように定義ができる。
 const arry = [1,2,3,4,5,6];

//要素の数を知りたい時
 arry.length で配列の要素の数を知ることができる

//配列の末尾にitemが追加される
arry.push("item");

//配列の先頭に代入できる
arry.unshift("hello");

//配列の末尾を削除できる
arry.pop()

//配列の先頭を削除することができる
arry.shift()
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