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 5 years have passed since last update.

localStrageで複数データを保存する

0
Posted at

データを保存する前に、文字列に一旦変換する必要があります。
JSON形式のデータを文字列に変換するために、JSON.stringify()メソッドを利用します。

データをセットする

localStorage.setItem("datalist", JSON.stringify(datalist));

データを引き出す

JSON.parse(localStorage.getItem("datalist"))  // -> {"data1":"hoge1", "data2":"hoge2"}

引用サイト
localStorageで複数のデータを保存する

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?